From: Hidetoshi NAGAI Date: 2006-10-22T01:55:52+09:00 Subject: Re: debugging using tk.rb From: Wybo Dekker Subject: Re: debugging using tk.rb Date: Sat, 21 Oct 2006 17:12:05 +0900 Message-ID: <45394DF5.6060601@servalys.nl> > For example, running the Pig Latin Generator from Dave's book > (attached): if I try to debug the pig method with > `break PigBox:pig', then hitting the `Pig It' button should stop me in > the pig method, but that doesn't happen. (I can, however) circumvent > this by setting the break point on the line number). > > And when I hit the `Exit' button, an error message pops up: > > FATAL I see. But unfortunately, there is no solution. The callback process of Ruby/Tk is a little complex. Longjmp must be handled very carefully, because it may break consistency of Ruby's stack, Tcl/Tk's stack, and Tcl/Tk's internal status. If not, such like as your trouble, longjmp causes SEGV easily. # Which version of Ruby/Tk do you use? > One of my real, rather complex, applications says, as soon as I enter > the Tk-window with my mouse: > > /home/wybo/bin/adm/admin:4:$: << File.dirname(__FILE__) files > (rdb:1) b ~/bin/admin_transaction.rb:108 > Set breakpoint 1 at ~/bin/admin_transaction.rb:108 > (rdb:1) c > /usr/local/lib/ruby/1.8/tk/event.rb:443: `invalid value for Integer: > "??"' (ArgumentError) That is fail of converting a event parameter to an object. Tcl/Tk returns a string "??" for an undefined parameter on a event. In that case, Tcl/Tk returns a "??" for the parameter which is expected as an integer. It may be a bug on Ruby/Tk. Could you show me your definition of binding? # Probably, you will be able to avoid the trouble # by using "%" substiturion arguments. -- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)