in reply to Identifying a location with finer granularity than a line number

WOW

I understand that Perl's breakpoint mechanism works only on a line bases at the level of support from the runtime.

Nope. From perldebug

b Sets breakpoint on current line b [line] [condition] Set a breakpoint before the given line. If a condition is specified, it's evaluated each time the statement is reached: a breakpoint is taken only if the condition is true. Breakpoints may only be set on lines that begin an executable statement. Conditions don't use "if": b 237 $x > 30 b 237 ++$count237 < 11 b 33 /pattern/i b subname [condition] Set a breakpoint before the first line of the named subroutine. *subname* may be a variable containing a code reference (in this case *condition* is not supported). b postpone subname [condition] Set a breakpoint at first line of subroutine after it is compiled. b load filename Set a breakpoint before the first executed line of the *filename*, which should be a full pathname found amongst the %INC values. b compile subname Sets a breakpoint before the first statement executed afte +r the specified subroutine is compiled.
Subname can be Some::Package::Name::subname
  • Comment on Re: Identifying a location with finer granularity than a line number
  • Download Code

Replies are listed 'Best First'.
Re^2: Identifying a location with finer granularity than a line number
by rockyb (Scribe) on Aug 14, 2012 at 08:39 UTC

    The sneaky operative word is "at the level of support from the runtime" by which I mean below the level of what can be done in Perl. On top of this run-time level, one can suppliment this in Perl to add what you see above (and more).

    Having said this though it is also true that one can hook into calls and returns. But it so happens in perl5db which is what you are citing above that is not done. Rather, when you specify a function name in a breakpoint, that gets translated into a file and line number and then a breakpoint is set on that, I believe. And as for hooking into the point of return which would be useful, that opportunity is also lost