develooper Front page | perl.perl5.porters | Postings from January 2013

[perl #71678] Bug [5.11.3] debugger bug in evaluation of user actions ('a' command)

Thread Previous | Thread Next
From:
James E Keenan via RT
Date:
January 28, 2013 01:11
Subject:
[perl #71678] Bug [5.11.3] debugger bug in evaluation of user actions ('a' command)
Message ID:
rt-3.6.HEAD-27190-1359335500-1642.71678-15-0@perl.org
On Tue Mar 27 18:24:27 2012, jkeenan wrote:
> On Tue Sep 28 01:07:49 2010, hexcoder wrote:
> > Greetings,
> > 
> > 
> > But it should be evaluated _once_ instead of thrice in your  test script
> > because control reaches line 11 only once.
> > The definition of the 'a' command is according to the debugger book
> > 'Pro Perl Debugging' from Richard Foley and Andy Lester
> > like this (on page 241):
> > "Create an action to run the supplied perl expression each time the code
> > on the given line number is about to be executed."
> > 
> > So the evaluation needs to take the line number into account, which it 
> > currently does not.
> > Once the action is activated, it is performed on each line upto the end 
> > of the scope (at least).
> > 
> > Note: this is not related to perlbug #71806 'perldb does not setup 
> > %dbline with shebang option -d',
> > because the behaviour is present also without shebang option -d.
> > > I don’ think it has to do with the end of the program. This script
> > > displays the message three times. I’ve never used the debugger before,
> > > so I don’t know whether this is correct. But it seems to me that
$action
> > > needs to be cleared elsewhere in the debugger.
> > >
> > > BEGIN {
> > > 	push @DB::typeahead, 'a 11 print "thrext\n"', 'c 8', ('s')x3, 'q';
> > > 	$DB::single = 0;
> > > }
> > > use strict; use warnings;
> > >
> > > greet('Hello');
> > >
> > > sub greet
> > > {
> > > 	my $arg = shift;
> > > 	print "$arg\n";
> > > 	return;
> > > }
> > > __END__
> > >
> > >
> > >
> > >   
> > 
> > I propose this example (see attachment), which uses a lexical variable 
> > from the inner scope:
> > ==== quote ========
> > BEGIN {
> >     push @DB::typeahead, 'a 12 print "${arg}__${arg}\n"', ('s')x4, 'q';
> >     $DB::single = 0;
> > }
> > use strict; use warnings;
> > 
> > greet('Hello');   # first stop in debugger
> > 
> > sub greet
> > {
> >     my $arg = shift;
> >     $arg = ''; # line 12
> >     return;
> > }
> > ===== end quote =======
> > 
> > Thanks, hexcoder
> > 
> 
> Discussion of this issue petered out about a year-and-a-half ago.  Is
> there anyone familiar with debugger issues who could review this RT?
> 
> Thank you very much.
> Jim Keenan

There have been many discussions about the Perl debugger on P5P during
the past year.  Can anyone who participated in those discussions take a
look at this ticket?

Thank you very much.
Jim Keenan


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=71678

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About