in reply to On debugging coderefs and inside evals

I know thatthe debugger store lots of information in special variables, including an array containing the lines being eval'ed. It may seem like an asinine answer, but perldebguts in the docs discusses how the debugger works and how to write your own debugger.

Cheers,
Erik
  • Comment on Re: On debugging coderefs and inside evals

Replies are listed 'Best First'.
Re: Re: On debugging coderefs and inside evals
by rinceWind (Monsignor) on Mar 16, 2002 at 20:17 UTC
    Thanks for the tip Erik, perldebguts has some clues as to what is happening.

    I have made some progress in that when the debugger is in a normal module, variables _<$filename contain what the documentation says to expect.

    When I'm inside one of my coderefs, I get the string __ANON__ or something like eval 6 quoted as a module name. I tried stuffing an array called _<__ANON with my lines of code, but this made no difference. Also, I'm presuming these debug variables are package not lexical, as they appear to be lumped together in a typeglob. Evidence suggests that all these debug variables go into package main::.

    I want a way of priming the debugger with my lines of code before it drops into the coderef.

    Update: Looking at perl5db.pl and perlfunc on caller, I see that what I need to do is fake a call, supplying the correct source and line information so that caller can see it. How to do this? I've re-read the chapters on XS programming in Advanced Perl programming , but this does not even mention the supplementary information passed into a call for the debugger. Maybe this book pre-dates perl5db. Any help would be appreciated.

    --rW