From: Jeff Putsch Date: 2003-04-17T03:33:31+09:00 Subject: Debugger not working in 1.8.0 snapshot --Apple-Mail-5--803635688 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Howdy, I've built ruby from the April 15, 2003 snapshot ("ruby -v" returns "ruby 1.8.0 (2003-04-15) [sparc-solaris2.6]"). I used gcc-3.2.1, built on Solaris 2.6 and am running on Solaris 2.6 and 8. Basically the debugger does not work. It does not stop at breakpoints. I suspect the issue is the same as was discussed in [ruby-talk:65644]. I have determined the problem is related to "debug.rb:check_break_points()" getting called with a pathname that is fully qualified. There is a commented out line (# file = File.basename(file)) at the beginning of that function. If I uncomment (enable) that line, then the debugger works. The attached patch to debug.rb adds minimal instrumentation to the file to help illustrate the problem, it is NOT a solution. If I apply the patch then do the following % cat /tmp/foobar.rb #!/usr/sepp/bin/ruby a=1 b=2 c=3 d=[a,b,c] p a p b p c p d d[1]=4 p b p d % /usr/sepp/bin/ruby -r debug /tmp/foobar.rb Debug.rb Emacs support available. /tmp/foobar.rb:3:a=1 (rdb:1) b 6 Set breakpoint 1 at foobar.rb:6 (rdb:1) c check_break_points: file = /tmp/foobar.rb Breakpoint 1 b = [true, 0, "foobar.rb", 6] check_break_points: file = /tmp/foobar.rb Breakpoint 1 b = [true, 0, "foobar.rb", 6] check_break_points: file = /tmp/foobar.rb Breakpoint 1 b = [true, 0, "foobar.rb", 6] check_break_points: file = /tmp/foobar.rb Breakpoint 1 b = [true, 0, "foobar.rb", 6] 1 check_break_points: file = /tmp/foobar.rb Breakpoint 1 b = [true, 0, "foobar.rb", 6] 2 check_break_points: file = /tmp/foobar.rb Breakpoint 1 b = [true, 0, "foobar.rb", 6] 3 check_break_points: file = /tmp/foobar.rb Breakpoint 1 b = [true, 0, "foobar.rb", 6] [1, 2, 3] check_break_points: file = /tmp/foobar.rb Breakpoint 1 b = [true, 0, "foobar.rb", 6] check_break_points: file = /tmp/foobar.rb Breakpoint 1 b = [true, 0, "foobar.rb", 6] 2 check_break_points: file = /tmp/foobar.rb Breakpoint 1 b = [true, 0, "foobar.rb", 6] [1, 4, 3] Notice that, in this case, check_break_points() is always called with the full path to the source file, while the breakpoint information has just the basename. Uncommenting the mentioned previously corrects this problem. Thanks, Jeff. --Apple-Mail-5--803635688 Content-Disposition: attachment; filename=debug.rb.patch Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name="debug.rb.patch" --- debug.rb.orig Wed Apr 16 10:52:05 2003 +++ debug.rb Wed Apr 16 11:18:08 2003 @@ -655,8 +655,10 @@ def check_break_points(file, pos, binding, id) return false if break_points.empty? # file = File.basename(file) + stdout.printf "check_break_points: file = #{file}\n" n = 1 for b in break_points + stdout.print "Breakpoint #{n} b = #{b.inspect}\n" if b[0] if b[1] == 0 and b[2] == file and b[3] == pos stdout.printf "Breakpoint %d, %s at %s:%s\n", n, debug_funcname(id), file, pos --Apple-Mail-5--803635688--