I went ahead and simplified the code + made an extension (you
can find it attached).
[Florian, are you reading this?]BTW, it now works with ruby 1.8 too (just remove the
File.expand_path calls in dbg.rb).
Excellent!
Attached is a fix for getting the correct binding.
rb_eval_string(“binding”) actually returns the binding for “eval”.
Changed:
args[4] = rb_eval_string(“binding”);
To:
args[4] = rb_funcall( self, rb_intern(“binding”), 0);
The binding is now correct:
(Dbg):caller
["./debugee.rb:8:in say'", "./debugee.rb:4:in
hello’", “dbg.rb:37”]
I’ll play around with porting most of the debug.rb functionality into a
console debugger - should not be too hard, as the signature for the
breakpoint_func is the same as for trace_func.
Any ideas on how to make this a remote debugger? Drb is nice, but my
goal is still to integrate this into eclipse, which means Drb is not
going to work (tried running a drb client from Jruby - no luck).
Cheers,
Max