From: Sys Ppp Date: 2009-08-24T22:23:35+09:00 Subject: Re: ruby-debug does not hit breakpoints at class-methods Rick Denatale wrote: > I don't know about rdebug in this case (I can't remember trying to set > breakpoints on method names, I usually just use the line number or set > the breakpoint in textmate using the rubyamp bundle), but normal > nomenclature, given a class > A#meth - refers to an instance method of A > A::meth - refers to a class method of A (note the double colon) > > This is what RI uses. RI also appears to accept > > A.meth > > which will give documentation on an instance method named meth is A > has one, or if not a class method named meth if there is one. > > For example ri IO.read gives info on IO#read (IO has both IO::read > and IO#read), while IO.select gives info on IO::select > > And RI doesn't appear to understand A:meth I know about conventions. And know about theoretical difference between class and instance methods. And also know that rdebug does not fully correspond these lexical conventions. But this case in point is technical aspects of rdebug. Though I do not say anything against possibility of better syntax. As it is seen, when during setting breakpoint it is pointed to some class and some method (no matter in which syntax), rdebug at runtime checks the class existing and just remembers the method name for later binding without checking. The problem is what later rdebug searches the method only in the dictionary of instance methods of the class, but neither of class-methods nor in dictionary singleton methods. I do not know how these dictionaries are realized, I just see the fact. I suppose what class methods and singleton methods of class-object are the same things. -- Posted via http://www.ruby-forum.com/.