On Tue, Jun 05, 2007 at 09:17:02AM +0200, Richard Foley wrote:
> On Monday 04 June 2007 16:45, Jay Rifkin wrote:
Richard and Jay,
Thank you for your suggestions.
In the end, I solved my problem by patching up perl5db.pl to call back
a user-defined routine on *every* loaded file from sub DB::postponed.
The ambiguous $filename is passed down to my subroutine, which converts
it to a canonical path using Cwd::abs_path and, if there are any pending
breakpoints (about which it was earlier told by the Java frontend),
it transfers them into $DB::postponed_file. This internal variable is
normally used by the debugger to keep track of all breakpoints that need
to be silently reinserted when re-running the script with the 'R' command.
Thanks to this solution I do not have to worry about "step over" stopping
at an unexpected point just because a file was "require"d during the step.
I do NOT set $single = 1 in my routine, I just install breakpoints
while the step command (or any continue command) is being processed
as usual. Of course, if one of the installed breakpoints is hit,
the debugger suspends, which is precisely what I want to happen.
The downsides are the possibly unreliable patching and the fact that
I now depend on perl5db.pl internals. What would be the best way to
suggest an API extension to perl5db.pl maintainer(s)?