From: "NAKAMURA, Hiroshi" Date: 2002-03-15T10:50:27+09:00 Subject: Re: Debugger problem Hi Nathaniel, > From: Nathaniel Talbott [mailto:nathaniel@talbott.ws] > Sent: Friday, March 15, 2002 3:08 AM > Perhaps this is a known issue, but given the following program: > > def a > puts "Hello" > end > > at_exit { > a > } > > If I load it up in the debugger, set a breakpoint on the puts > line, and > run it, the breakpoint is never reached (even though the program still > does the right thing). trace_func is removed at at_exit. Workaround; $ ruby -d -rdebug foo.rb Debug.rb Emacs support available. foo.rb:1:def a (rdb:1) list 0-999 [0, 999] in foo.rb => 1 def a 2 puts "Hello" 3 end 4 5 at_exit do 6 set_trace_func proc { |event, file, line, id, binding, klass, *rest| 7 DEBUGGER__.context.trace_func event, file, line, id, binding, klass 8 } if $DEBUG 9 a 10 end (rdb:1) break a Set breakpoint 1 at foo.rb:a (rdb:1) cont Breakpoint 1, a at foo.rb:a foo.rb:1:def a (rdb:1) where --> #1 foo.rb:1:in `a' #2 foo.rb:9 (rdb:1) finish Hello Regards, // NaHi