[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Stupid Debugger Questions



On Wed, Dec 27, 2000 at 08:17:25PM -0500, Jim Correia wrote:
> Given the following program:
> 
> #!perl -w
> use strict;
> 
> my $f = "testing";
> 
> print $f;
> 
> If I stop before the print, and execute the command V main f I get no
> output, why?

The V and X debugger commands are used to view variables in a specific
package.  However, lexical variables (those declared with my) are not in
any package.  The x command should be used to examine the values of lexical
variables.


> Is there anyway to dump all the local variables in a subroutine?

As far as I know, there is no way in the debugger to dump all the lexical
variables.  :/  There's no way in Perl to get a list of lexical variables.


> Is there anyway to do this automagically after every step?
> 
> The documentation says the line number for a is optional, but when I
> write
> 
> a print "Hello Cruel World"
> 
> the debugger complains
> 
>     # syntax error, near "a print"
>     File '(eval 2155)'; Line 2
> 
> A doesn't clear all actions for me - is this a known bug?

a and A weren't implemented properly in old versions of the Perl debugger.
:/  Fortunately, the debugger is backwards compatible; you can download the
source for 5.6.0 and use its perl5db.pl in your current installation.


> a lineNum expr
> 
> expr seems to need to be valid perl - for example I can't use a debugger
> command here like x $s.  Is that true?  Is there any way to set an
> action on a line number that is a debugger command?

As far as I know, no.  :/


Ronald

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org