e$B5WJ]$G$9!#e(B
ruby 1.9 e$B$G0J2<$N>r7o$N$H$-!"e(B[BUG] unsupported: th_call0
e$B$H$J$j$^$7$?!#e(B
- private e$B$J%a%=%C%I$r%5%V%/%i%9$Ge(B public e$B$K$9$k!#e(B
- e$B3HD%%i%$%V%i%j$+$i%5%V%/%i%9$Ge(B public e$B$K$7$?%a%=%C%I$re(B
rb_funcall
e$B$G8F$S=P$9!#e(B
DateTime#hour
e$B$,$3$N$h$&$J%a%=%C%I$G!"3HD%%i%$%V%i%j$+$i8F$S=P$=$&$He(B
e$B$7$?$i%(%i!<$K$J$j$^$7$?!#e(Bruby 1.8 e$B$G$OLdBj$J$/;H$($^$7$?!#e(B
e$B0J2<!":F8=J}K!e(B
= e$B%=!<%9#3$De(B(extconf.rb, mytest.c, mytest.rb)
extconf.rb:
require ‘mkmf’
create_makefile(‘mytest’)
mytest.c:
/*
- class MyTest
- def self.run(arg)
-
arg.run
- end
- end
*/
#include <ruby.h>
static VALUE mytest_run(VALUE klass, VALUE arg)
{
return rb_funcall(arg, rb_intern(“run”), 0);
}
void Init_mytest()
{
VALUE cMyTest = rb_define_class(“MyTest”, rb_cObject);
rb_define_singleton_method(cMyTest, “run”, mytest_run, 1);
}
mytest.rb:
require ‘./mytest.so’
class A
def run
‘OK’
end
private :run
end
class B < A
public :run
end
puts MyTest.run(B.new)
= e$B3HD%%i%$%V%i%je(B mytest.so e$B$r:n@.$7$Fe(B mytest.rb e$B$r<B9Te(B
ruby extconf.rb
make
ruby mytest.rb
= e$B<B9T7k2Le(B
– stack frame ------------
0000 (0xb7caa008): 00000004
0001 (0xb7caa00c): 00000005
0002 (0xb7caa010): 00000004
0003 (0xb7caa014): 00000001
0004 (0xb7caa018): 00000004
0005 (0xb7caa01c): b7d74b70
0006 (0xb7caa020): b7d748f0
0007 (0xb7caa024): 00000004
0008 (0xb7caa028): 00000001 <- lfp <- dfp
– control frame ----------
c:0004 p:---- s:0009 b:0009 l:000008 d:000008 CFUNC :run
c:0003 p:0057 s:0005 b:0004 l:000003 d:000003 TOP mytest.rb:14
c:0002 p:---- s:0002 b:0002 l:000001 d:000001 FINISH
c:0001 p:---- s:0000 b:-001 l:000000 d:000000 ------
DBG> : “mytest.rb:14:in `’”
– backtrace of native function call (Use addr2line) –
0x80d83da
0x80ef150
0x80d6fb2
0x805947f
0x8059936
0xb7e2f6b5
0x80d429e
0x80d666d
0x80d69b8
0x8058fdb
0x8059016
0x805c670
0x80567af
0xb7e4aea8
0x80566e1
[BUG] unsupported: th_call0
ruby 1.9.0 (2007-02-21) [i686-linux]
e$B%"%!<%H$7$^$7$?e(B