But it really isn’t a problem. A fully qualified method name is unique, so I
see no need to distinguish the singleton case as long as a breakpoint can be
specified using the same syntax as any other method. Or am I missing
something?
···
On Wednesday 26 February 2003 01:23 am, Yukihiro Matsumoto wrote:
Hi,
In message “Re: Debugger Not Working” > > on 03/02/26, “NAKAMURA, Hiroshi” nahi@keynauts.com writes:
But under current ruby’s trace API that debug.rb uses,
we cannot distinguish singleton method from instance
method, right?
Right.
matz.
–
Seth Kurtzberg
M. I. S. Corp.
480-661-1849
seth@cql.com
You want the file name plus the class name plus dot plus the method?
Interesting totally undocumented feature. 
···
On Wednesday 26 February 2003 02:03 am, NAKAMURA, Hiroshi wrote:
Hi,
From: Seth Kurtzberg [mailto:seth@cql.com]
Sent: Wednesday, February 26, 2003 5:26 PM
It accepts it. But nothing happens (that is, it doesn’t
actually set a
breakpoint at the desired location). With 1.8, at least.
nakahiro@RUBY ~/test
$ cat foo.rb
module Foo
class Bar
def self.baz; end
end
end
Foo::Bar.baz
nakahiro@RUBY ~/test
$ ruby -rdebug foo.rb
Debug.rb
Emacs support available.
foo.rb:1:module Foo
(rdb:1) break Foo::Bar:baz
Set breakpoint 1 at Foo::Bar:baz
(rdb:1) cont
Breakpoint 1, baz at Foo::Bar:baz
foo.rb:3: def self.baz; end
(rdb:1) finish
nakahiro@RUBY ~/test
$
You may be setting bp with ‘Bar:baz’, not ‘Foo::Bar:baz’?
Regards,
// NaHi
–
Seth Kurtzberg
M. I. S. Corp.
480-661-1849
seth@cql.com
Hi, Seth,
From: Seth Kurtzberg [mailto:seth@cql.com]
Sent: Thursday, February 27, 2003 12:54 AM
You want the file name plus the class name plus dot plus
the method?
No.
debug.rb wants the fully qualified class name plus colon plus
the method.
Regards,
// NaHi
What is the difference between a fully qualified class name, and
FileName:ClassName?
···
On Wednesday 26 February 2003 10:16 pm, NAKAMURA, Hiroshi wrote:
Hi, Seth,
From: Seth Kurtzberg [mailto:seth@cql.com]
Sent: Thursday, February 27, 2003 12:54 AM
You want the file name plus the class name plus dot plus
the method?
No.
debug.rb wants the fully qualified class name plus colon plus
the method.
Regards,
// NaHi
–
Seth Kurtzberg
M. I. S. Corp.
480-661-1849
seth@cql.com
Hi,
From: Seth Kurtzberg [mailto:seth@cql.com]
Sent: Thursday, February 27, 2003 3:10 PM
What is the difference between a fully qualified class name, and
FileName:ClassName?
In the previous example,
break Foo::Bar:baz
Foo::Bar does not mean ‘FileName:ClassName’.
It means ‘class Bar in module Foo’.
nakahiro@RUBY ~/test
$ cat no_such_class.rb
module Foo
class Bar
def baz; end
def qux; end
end
end
o = Foo::Bar.new
o.baz
o.qux
nakahiro@RUBY ~/test
$ ruby -rdebug no_such_class.rb
Debug.rb
Emacs support available.
no_such_class.rb:1:module Foo
(rdb:1) break no_such_class.rb:baz # (A)
Set breakpoint 1 at no_such_class.rb:baz
(rdb:1) break Foo::Bar:qux
Set breakpoint 2 at Foo::Bar:qux # (B)
(rdb:1) cont
Breakpoint 1, baz at no_such_class.rb:baz
no_such_class.rb:3: def baz; end
(rdb:1) cont
Breakpoint 2, qux at Foo::Bar:qux
no_such_class.rb:4: def qux; end
(rdb:1) finish
nakahiro@RUBY ~/test
$
Breakpoint syntax.
- break (filename:)(lineno|method_name)
- break (fullyQualifiedClassName:)(lineno|method_name)
(A) is an example for 1. (B) for 2.
Regards,
// NaHi
Oh, I see.
So if the code is not in a file with a module declaration, you can only set
breakpoints using a line number.
···
On Thursday 27 February 2003 12:22 am, NAKAMURA, Hiroshi wrote:
Hi,
From: Seth Kurtzberg [mailto:seth@cql.com]
Sent: Thursday, February 27, 2003 3:10 PM
What is the difference between a fully qualified class name, and
FileName:ClassName?
In the previous example,
break Foo::Bar:baz
Foo::Bar does not mean ‘FileName:ClassName’.
It means ‘class Bar in module Foo’.
nakahiro@RUBY ~/test
$ cat no_such_class.rb
module Foo
class Bar
def baz; end
def qux; end
end
end
o = Foo::Bar.new
o.baz
o.qux
nakahiro@RUBY ~/test
$ ruby -rdebug no_such_class.rb
Debug.rb
Emacs support available.
no_such_class.rb:1:module Foo
(rdb:1) break no_such_class.rb:baz # (A)
Set breakpoint 1 at no_such_class.rb:baz
(rdb:1) break Foo::Bar:qux
Set breakpoint 2 at Foo::Bar:qux # (B)
(rdb:1) cont
Breakpoint 1, baz at no_such_class.rb:baz
no_such_class.rb:3: def baz; end
(rdb:1) cont
Breakpoint 2, qux at Foo::Bar:qux
no_such_class.rb:4: def qux; end
(rdb:1) finish
nakahiro@RUBY ~/test
$
Breakpoint syntax.
- break (filename:)(lineno|method_name)
- break (fullyQualifiedClassName:)(lineno|method_name)
(A) is an example for 1. (B) for 2.
Regards,
// NaHi
–
Seth Kurtzberg
M. I. S. Corp.
480-661-1849
seth@cql.com