Re: Call perl5db or trepan.pl from re.pl

2012-09-13 Thread Rocky Bernstein
On Sat, Jan 7, 2012 at 11:42 PM (a long while ago),  Rocky Bernstein

> - - -
>
> I was looking at perl5db code and noticed that numeric value of @dbline is
> its COP reference. (In trepan.pl "info program" now shows this when it is
> available). I thought this would be a win for being able to more precisely
> indicate where you are and to  set breakpoints within lines which have
> multiple statements on them.
>
> Such an example line might be:
>
> if ($x) { $y--; if ($y) { $z += 1 } else { $z -= 1 }; } else { $z = 10 };
>
> If you disassemble via B::Concise, you'll see several COPs for this line.
> However the @dbline entry for that line always seems to be the first COP
> rather than the one that called DB::DB.
>

What I've been looking for is Devel::Callsite


Call perl5db or trepan.pl from re.pl

2012-01-07 Thread Rocky Bernstein
I recently I've written Devel::REPL plugins to call a trepan or perl5db
debugger from re.pl via Enbugger.
If there are other plugins for this, I'd be interested to compare.

https://github.com/rocky/Perl-Devel-Trepan-Shell has the code.

In my repl.rc load the plugins:

   $_REPL->load_plugin('Trepan');
   $_REPL->load_plugin('Perl5db');

Then to get into the debugger
   %trepan  your-code-here

or
   %perl5db some-other-code-here

More could be done to better show return values, and there are some
weirdnesses in the trepan plugin when re.pl
is exited, but overall it works.

- - -

I was looking at perl5db code and noticed that numeric value of @dbline is
its COP reference. (In trepan.pl "info program" now shows this when it is
available). I thought this would be a win for being able to more precisely
indicate where you are and to  set breakpoints within lines which have
multiple statements on them.

Such an example line might be:

if ($x) { $y--; if ($y) { $z += 1 } else { $z -= 1 }; } else { $z = 10 };

If you disassemble via B::Concise, you'll see several COPs for this line.
However the @dbline entry for that line always seems to be the first COP
rather than the one that called DB::DB.