You have the source code. Why don't you take a look at it? Your requested feature is dang simple to add. For example (skipping the re-indenting of some lines in order to make the 'diff' smaller):

--- perl-5.10.1/lib/perl5db.pl +++ ~/lib/perl5db.pl @@ -1957,9 +1957,14 @@ for ( my $n = 0 ; $n <= $#to_watch ; $n++ ) { $evalarg = $to_watch[$n]; + my $val; + if( ref $evalarg ) { + $val = $$evalarg; + } else { local $onetimeDump; # Tell DB::eval() to not output re +sults # Fix context DB::eval() wants to return an array, but # we need a scalar here. - my ($val) = join( "', '", &eval ); + ($val) = join( "', '", &eval ); + } $val = ( ( defined $val ) ? "'$val'" : 'undef' ); @@ -5289,5 +5294,12 @@ # ... save it. - push @to_watch, $expr; + my $val; + if( $expr =~ /^\$\w+$/ ) { + $evalarg = "\\$expr"; + ( $val ) = &eval; + push @to_watch, $val; + $val = $$val; + } else { + push @to_watch, $expr; # Parameterize DB::eval and call it to get the expression's v +alue @@ -5295,5 +5307,6 @@ # return a list value. $evalarg = $expr; - my ($val) = join( ' ', &eval ); + ($val) = join( ' ', &eval ); + } $val = ( defined $val ) ? "'$val'" : 'undef';

If you ask for the list of watch expressions, the simple ones will be displayed in a rather useless manner. And you should probably weaken the reference taken as otherwise adding a watch point could prevent a destructor from firing.

On the plus side, I suspect that the new simple watch points will have less of a performance impact than the previous implementation imposed.

- tye        


In reply to Re: Debugger Questions - Variable Scope (source++) by tye
in thread Debugger Questions - Variable Scope by GotToBTru

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.