Debugger not working in 1.8.0 snapshot

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)

It also seems a change introduced between at rev 1.37 of debug.rb makes
it difficult for me to attempt to set breakpoints based on file names.
For example, I get:

 (rdb:1) b PgSQL.rb:updateDisks
 foobar.rb: unitialized constant PgSQL.rb

And if I step until I’m in a method defined in the PgSQL.rb file, then
set a breakpoint, the “file” seems to be set to a class object.

Something is not correct …

Any help/guidance will be greatly appreciated.

Thanks,

Jeff.

It also seems a change introduced between at rev 1.37 of debug.rb
makes it difficult for me to attempt to set breakpoints based on file
names. For example, I get:

(rdb:1) b PgSQL.rb:updateDisks
foobar.rb: unitialized constant PgSQL.rb

That should be:

 (rdb:1) b PgSQL.rb:updateDisks
 foobar.rb: unitialized constant PgSQL

And if I step until I’m in a method defined in the PgSQL.rb file, then
set a breakpoint, the “file” seems to be set to a class object.

My fault, I had left the “file = File.basename(file)” uncommented in
debug.rb from my earlier testing.

So… I cannot set a breakpoint based on filenames, and cannot get the
debugger to stop at those breakpoints I do set.

Thanks,

Jeff.

···

On Wednesday, April 16, 2003, at 01:07 PM, Jeff Putsch wrote: