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.
debug.rb.patch (526 Bytes)