Closed p5pRT closed 11 years ago
This is a bug report for perl from dotan@corky.net\, generated with the help of perlbug 1.39 running under perl 5.18.0.
In perl 5.18.0\, @_ isn't visible in the debugger (perl -d). You can't insepct it with x (eval/dump) or w (watch).
Example: perl -dE 'sub f { say $_ for (@_); $a = $_[1]; say $a;}; f(4\,25\,7);' DB\<1> s ... DB\<1> x @_ empty array
Flags: category=core severity=high
Site configuration information for perl 5.18.0:
Configured by dotandimet at Mon May 20 22:37:44 IDT 2013.
Summary of my perl5 (revision 5 version 18 subversion 0) configuration:
Platform: osname=darwin\, osvers=12.3.0\, archname=darwin-2level uname='darwin ariel.local 12.3.0 darwin kernel version 12.3.0: sun jan 6 22:37:10 pst 2013; root:xnu-2050.22.13~1release_x86_64 x86_64 ' config_args='-de -Dprefix=/Users/dotandimet/perl5/perlbrew/perls/perl-5.18.0 -Aeval:scriptdir=/Users/dotandimet/perl5/perlbrew/perls/perl-5.18.0/bin' hint=recommended\, useposix=true\, d_sigaction=define useithreads=undef\, usemultiplicity=undef useperlio=define\, d_sfio=undef\, uselargefiles=define\, usesocks=undef use64bitint=define\, use64bitall=define\, uselongdouble=undef usemymalloc=n\, bincompat5005=undef Compiler: cc='cc'\, ccflags ='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'\, optimize='-O3'\, cppflags='-fno-common -DPERL_DARWIN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion=''\, gccversion='4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)'\, gccosandvers='' intsize=4\, longsize=8\, ptrsize=8\, doublesize=8\, byteorder=12345678 d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=16 ivtype='long'\, ivsize=8\, nvtype='double'\, nvsize=8\, Off_t='off_t'\, lseeksize=8 alignbytes=8\, prototype=define Linker and Libraries: ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc'\, ldflags =' -fstack-protector -L/usr/local/lib' libpth=/usr/local/lib /usr/lib libs=-ldbm -ldl -lm -lutil -lc perllibs=-ldl -lm -lutil -lc libc=\, so=dylib\, useshrplib=false\, libperl=libperl.a gnulibc_version='' Dynamic Linking: dlsrc=dl_dlopen.xs\, dlext=bundle\, d_dlsymun=undef\, ccdlflags=' ' cccdlflags=' '\, lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -fstack-protector'
Locally applied patches:
@INC for perl 5.18.0: /Users/dotandimet/perl5/perlbrew/perls/perl-5.18.0/lib/site_perl/5.18.0/darwin-2level /Users/dotandimet/perl5/perlbrew/perls/perl-5.18.0/lib/site_perl/5.18.0 /Users/dotandimet/perl5/perlbrew/perls/perl-5.18.0/lib/5.18.0/darwin-2level /Users/dotandimet/perl5/perlbrew/perls/perl-5.18.0/lib/5.18.0 .
Environment for perl 5.18.0: DYLD_LIBRARY_PATH (unset) HOME=/Users/dotandimet LANG=en_US.UTF-8 LANGUAGE (unset) LC_CTYPE=UTF-8 LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/Users/dotandimet/perl5/perlbrew/bin:/Users/dotandimet/perl5/perlbrew/perls/perl-5.18.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/Users/dotandimet/bin:/Developer/usr/bin PERLBREW_BASHRC_VERSION=0.58 PERLBREW_HOME=/Users/dotandimet/.perlbrew PERLBREW_MANPATH=/Users/dotandimet/perl5/perlbrew/perls/perl-5.18.0/man PERLBREW_PATH=/Users/dotandimet/perl5/perlbrew/bin:/Users/dotandimet/perl5/perlbrew/perls/perl-5.18.0/bin PERLBREW_PERL=perl-5.18.0 PERLBREW_ROOT=/Users/dotandimet/perl5/perlbrew PERLBREW_VERSION=0.58 PERL_BADLANG (unset) SHELL=/bin/bash
On Fri May 24 22:24:07 2013\, dotandimet@gmail.com wrote:
This is a bug report for perl from dotan@corky.net\, generated with the help of perlbug 1.39 running under perl 5.18.0.
----------------------------------------------------------------- In perl 5.18.0\, @_ isn't visible in the debugger (perl -d). You can't inspect it with x (eval/dump) or w (watch).
Example: perl -dE 'sub f { say $_ for (@_); $a = $_[1]; say $a;}; f(4\,25\,7);' DB\<1> s ... DB\<1> x @_ empty array
----------------------------------------------------------------- --- Flags: category=core severity=high --- Site configuration information for perl 5.18.0:
Configured by dotandimet at Mon May 20 22:37:44 IDT 2013.
Summary of my perl5 (revision 5 version 18 subversion 0) configuration:
This does seem to be a regression from 5.16.0:
##### $ /usr/local/bin/perl5.16.0 -d 118169-debug.pl
Loading DB routines from perl5db.pl version 1.37 Editor support available.
Enter h or 'h h' for help\, or 'man perldebug' for more help.
main::(118169-debug.pl:4): use Data::Dumper;$Data::Dumper::Indent=1; DB\<1> n main::(118169-debug.pl:7): f(4\,25\,7); DB\<1> s main::f(118169-debug.pl:10): say $_ for (@_); DB\<1> x @_ 0 4 1 25 2 7 #####
The RT System itself - Status changed from 'new' to 'open'
On Sat May 25 17:33:45 2013\, jkeenan wrote:
On Fri May 24 22:24:07 2013\, dotandimet@gmail.com wrote:
This is a bug report for perl from dotan@corky.net\, generated with the help of perlbug 1.39 running under perl 5.18.0.
----------------------------------------------------------------- In perl 5.18.0\, @_ isn't visible in the debugger (perl -d). You can't inspect it with x (eval/dump) or w (watch).
Example: perl -dE 'sub f { say $_ for (@_); $a = $_[1]; say $a;}; f(4\,25\,7);' DB\<1> s ... DB\<1> x @_ empty array
----------------------------------------------------------------- --- Flags: category=core severity=high --- Site configuration information for perl 5.18.0:
Configured by dotandimet at Mon May 20 22:37:44 IDT 2013.
Summary of my perl5 (revision 5 version 18 subversion 0) configuration:
This does seem to be a regression from 5.16.0:
##### $ /usr/local/bin/perl5.16.0 -d 118169-debug.pl
Loading DB routines from perl5db.pl version 1.37 Editor support available.
Enter h or 'h h' for help\, or 'man perldebug' for more help.
main::(118169-debug.pl:4): use Data::Dumper;$Data::Dumper::Indent=1; DB\<1> n main::(118169-debug.pl:7): f(4\,25\,7); DB\<1> s main::f(118169-debug.pl:10): say $_ for (@_); DB\<1> x @_ 0 4 1 25 2 7 #####
It was caused by:
commit 7c54f46a95be02b1ca921f4d4521122267d801cd Author: Shlomi Fish \shlomif@​shlomifish\.org Date: Mon Oct 1 20:40:13 2012 +0200
perl5db: no longer passing arguments to DB::eval().
It didn't accept any arguments anyway.
element # that it will be stored in. local $saved[0]; # Preserve the old value of $@ - eval { &DB::save }; + eval { DB::save() };
# Now see whether we need to report an error back to the user. if ($at) { @@ -1929\,7 +1929\,7 @@ If there are any preprompt actions\, execute those as well. =cut
# If there's an action\, do it now. - $evalarg = $action\, DB::eval(@_) if $action; + $evalarg = $action\, DB::eval() if $action;
# Are we nested another level (e.g.\, did we evaluate a function # that had a breakpoint in it at the debugger prompt)? @@ -1940\,7 +1940\,7 @@ If there are any preprompt actions\, execute those as well.
# Do any pre-prompt actions. foreach $evalarg (@$pre) { - DB::eval(@_); + DB::eval(); }
# Complain about too much recursion if we passed the limit.
@@ -3273\,7 +3273\,7 @@ any variables we might want to address in the
C\
# Run *our* eval that executes in the caller's context. - DB::eval(@_); + DB::eval();
# Turn off the one-time-dump stuff now. if ($onetimeDump) { @@ -3374\,7 +3374\,7 @@ again.
# Evaluate post-prompt commands. foreach $evalarg (@$post) { - DB::eval(@_); + DB::eval(); } } # if ($single || $signal)
@@ -3477\,7 +3477\,7 @@ sub _DB__handle_watch_expressions
# Fix context DB::eval() wants to return an array\, but # we need a scalar here. - my ($val) = join( "'\, '"\, DB::eval(@_) ); + my ($val) = join( "'\, '"\, DB::eval() ); $val = ( ( defined $val ) ? "'$val'" : 'undef' );
# Did it change? @@ -5075\,7 +5075\,7 @@ sub cmd_i { my $line = shift; foreach my $isa ( split( /\s+/\, $line ) ) { $evalarg = $isa; - ($isa) = DB::eval(@_); + ($isa) = DB::eval(); no strict 'refs'; print join( '\, '\, @@ -5120\,7 +5120\,7 @@ sub cmd_l { # Set up for DB::eval() - evaluate in *user* context. $evalarg = $1; # $evalarg = $2; - my ($s) = DB::eval(@_); + my ($s) = DB::eval();
# Ooops. Bad scalar. if ($@) { @@ -5523\,7 +5523\,7 @@ sub _add_watch_expr { # in the user's context. This version can handle expressions which # return a list value. $evalarg = $expr; - my ($val) = join( ' '\, DB::eval(@_) ); + my ($val) = join( ' '\, DB::eval() ); $val = ( defined $val ) ? "'$val'" : 'undef';
# Save the current value of the expression. @@ -9744\,7 +9744\,7 @@ sub cmd_pre580_W { # Get the current value of the expression. # Doesn't handle expressions returning list values! $evalarg = $1; - my ($val) = DB::eval(@_); + my ($val) = DB::eval(); $val = ( defined $val ) ? "'$val'" : 'undef';
# Save it.
--
Father Chrysostomos
On Sun May 26 01:29:38 2013\, sprout wrote: [snip]
It was caused by:
commit 7c54f46a95be02b1ca921f4d4521122267d801cd Author: Shlomi Fish \shlomif@​shlomifish\.org Date: Mon Oct 1 20:40:13 2012 +0200
perl5db​: no longer passing arguments to DB​::eval\(\)\. It didn't accept any arguments anyway\.
The patch attached represents *manual* corrections to the commit in question. (I tried git-revert\, but there were conflicts\, perhaps because there were intervening commits in the same file.)
The patch appears to correct the 'x @_' case reported by the OP and confirmed by me yesterday.
##### $ ./perl -I./lib -d ~/p5p/118169-debug.pl
Loading DB routines from perl5db.pl version 1.39_10 Editor support available.
Enter h or 'h h' for help\, or 'man perldebug' for more help.
main::(/home/jkeenan/p5p/118169-debug.pl:7): 7: f(4\,25\,7); DB\<1> s main::f(/home/jkeenan/p5p/118169-debug.pl:10): 10: say $_ for (@_); DB\<1> x @_ 0 4 1 25 2 7 DB\<2> w @_ DB\<3> n 4 25 7 #####
I'm not familiar enough with 'w' to say whether my patch remedies that problem. In either case\, even if this patch is satisfactory\, we'll have to figure out a way to write a regression test.
Please review.
Thank you very much. Jim Keenan
Hi all\,
On Sun May 26 05:51:24 2013\, jkeenan wrote:
On Sun May 26 01:29:38 2013\, sprout wrote: [snip]
It was caused by:
commit 7c54f46a95be02b1ca921f4d4521122267d801cd Author: Shlomi Fish \shlomif@​shlomifish\.org Date: Mon Oct 1 20:40:13 2012 +0200
perl5db​: no longer passing arguments to DB​::eval\(\)\. It didn't accept any arguments anyway\.
The patch attached represents *manual* corrections to the commit in question. (I tried git-revert\, but there were conflicts\, perhaps because there were intervening commits in the same file.)
Attached is my own patch which appears to correct the problem (at least with x). I also added a test. Sorry for not noticing that earlier and making James work on it as well.
You can also find it at this github branch:
https://github.com/shlomif/perl/tree/rt118169_fix_perl_debugger_at_underscore_in_x
Regards\,
-- Shlomi Fish
Hi Jim\,
On Sun May 26 05:51:24 2013\, jkeenan wrote:
On Sun May 26 01:29:38 2013\, sprout wrote: [snip]
It was caused by:
commit 7c54f46a95be02b1ca921f4d4521122267d801cd Author: Shlomi Fish \shlomif@​shlomifish\.org Date: Mon Oct 1 20:40:13 2012 +0200
perl5db​: no longer passing arguments to DB​::eval\(\)\. It didn't accept any arguments anyway\.
The patch attached represents *manual* corrections to the commit in question. (I tried git-revert\, but there were conflicts\, perhaps because there were intervening commits in the same file.)
The patch appears to correct the 'x @_' case reported by the OP and confirmed by me yesterday.
##### $ ./perl -I./lib -d ~/p5p/118169-debug.pl
Loading DB routines from perl5db.pl version 1.39_10 Editor support available.
Enter h or 'h h' for help\, or 'man perldebug' for more help.
main::(/home/jkeenan/p5p/118169-debug.pl:7): 7: f(4\,25\,7); DB\<1> s main::f(/home/jkeenan/p5p/118169-debug.pl:10): 10: say $_ for (@_); DB\<1> x @_ 0 4 1 25 2 7 DB\<2> w @_ DB\<3> n 4 25 7 #####
I'm not familiar enough with 'w' to say whether my patch remedies that problem. In either case\, even if this patch is satisfactory\, we'll have to figure out a way to write a regression test.
My patch contains a regression test\, but its regex can be made more specific for the x test.
Please review.
Well\, this patch still needs a regression test.
Thank you very much. Jim Keenan
Regards\,
-- Shlomi Fish
On Sun May 26 06:45:09 2013\, shlomif wrote:
Hi all\,
On Sun May 26 05:51:24 2013\, jkeenan wrote:
On Sun May 26 01:29:38 2013\, sprout wrote: [snip]
It was caused by:
commit 7c54f46a95be02b1ca921f4d4521122267d801cd Author: Shlomi Fish \shlomif@​shlomifish\.org Date: Mon Oct 1 20:40:13 2012 +0200
perl5db​: no longer passing arguments to DB​::eval\(\)\. It didn't accept any arguments anyway\.
The patch attached represents *manual* corrections to the commit in question. (I tried git-revert\, but there were conflicts\, perhaps because there were intervening commits in the same file.)
Attached is my own patch which appears to correct the problem (at least with x). I also added a test. Sorry for not noticing that earlier and making James work on it as well.
You can also find it at this github branch:
https://github.com/shlomif/perl/tree/rt118169_fix_perl_debugger_at_underscore_in_x
I havenât had a chance to test your patch yet. But also consider manipulability of @_:
$ perl -v
This is perl 5\, version 12\, subversion 4 (v5.12.4) built for darwin-thread-multi-2level (with 2 registered patches\, see perl -V for more detail)
Copyright 1987-2010\, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the GNU General Public License\, which may be found in the Perl 5 source kit.
Complete documentation for Perl\, including FAQ lists\, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet\, point your browser at http://www.perl.org/\, the Perl Home Page.
$ perl -de 'BEGIN{@DB::typeahead=("s"\,"shift \@_"\, "c"\, "q");} sub f { chop; print "-----> @_\n" } f(1\,2\,3)'
Loading DB routines from perl5db.pl version 1.33 Editor support available.
Enter h or `h h' for help\, or `man perldebug' for more help.
main::(-e:1): BEGIN{@DB::typeahead=("s"\,"shift \@_"\, "c"\, "q");} sub f { chop; print "-----> @_\n" } f(1\,2\,3) auto(-4) DB\<1> s main::f(-e:1): BEGIN{@DB::typeahead=("s"\,"shift \@_"\, "c"\, "q");} sub f { chop; print "-----> @_\n" } f(1\,2\,3) auto(-3) DB\<1> shift @_
auto(-2) DB\<2> c
-----> 2 3
Debugged program terminated. Use q to quit or R to restart\,
use o inhibit_exit to avoid stopping after program termination\,
h q\, h R or h o to get additional info.
auto(-1) DB\<2> q
__END__
That fails in current blead (prints â1 2 3â). I havenât checked whether your patch addresses that.
--
Father Chrysostomos
Hi Father C\,
On Sun May 26 07:44:41 2013\, sprout wrote:
On Sun May 26 06:45:09 2013\, shlomif wrote:
Hi all\,
On Sun May 26 05:51:24 2013\, jkeenan wrote:
On Sun May 26 01:29:38 2013\, sprout wrote: [snip]
It was caused by:
commit 7c54f46a95be02b1ca921f4d4521122267d801cd Author: Shlomi Fish \shlomif@​shlomifish\.org Date: Mon Oct 1 20:40:13 2012 +0200
perl5db​: no longer passing arguments to DB​::eval\(\)\. It didn't accept any arguments anyway\.
The patch attached represents *manual* corrections to the commit in question. (I tried git-revert\, but there were conflicts\, perhaps because there were intervening commits in the same file.)
Attached is my own patch which appears to correct the problem (at least with x). I also added a test. Sorry for not noticing that earlier and making James work on it as well.
You can also find it at this github branch:
https://github.com/shlomif/perl/tree/rt118169_fix_perl_debugger_at_underscore_in_x
I havenât had a chance to test your patch yet. But also consider manipulability of @_:
$ perl -v
This is perl 5\, version 12\, subversion 4 (v5.12.4) built for darwin-thread-multi-2level (with 2 registered patches\, see perl -V for more detail)
Copyright 1987-2010\, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the GNU General Public License\, which may be found in the Perl 5 source kit.
Complete documentation for Perl\, including FAQ lists\, should be found on this system using "man perl" or "perldoc perl". If you have access to the Internet\, point your browser at http://www.perl.org/\, the Perl Home Page.
$ perl -de 'BEGIN{@DB::typeahead=("s"\,"shift \@_"\, "c"\, "q");} sub f { chop; print "-----> @_\n" } f(1\,2\,3)'
Loading DB routines from perl5db.pl version 1.33 Editor support available.
Enter h or `h h' for help\, or `man perldebug' for more help.
main::(-e:1): BEGIN{@DB::typeahead=("s"\,"shift \@_"\, "c"\, "q");} sub f { chop; print "-----> @_\n" } f(1\,2\,3) auto(-4) DB\<1> s main::f(-e:1): BEGIN{@DB::typeahead=("s"\,"shift \@_"\, "c"\, "q");} sub f { chop; print "-----> @_\n" } f(1\,2\,3) auto(-3) DB\<1> shift @_
auto(-2) DB\<2> c -----> 2 3 Debugged program terminated. Use q to quit or R to restart\, use o inhibit_exit to avoid stopping after program termination\, h q\, h R or h o to get additional info. auto(-1) DB\<2> q __END__
That fails in current blead (prints â1 2 3â). I havenât checked whether your patch addresses that.
Checked now\, and it didn't. I've written another patch to address it in my branch\, and it's attached to this message. It should be applied on top of the previous patch. See:
https://github.com/shlomif/perl/tree/rt118169_fix_perl_debugger_at_underscore_in_x
Regards\,
-- Shlomi Fish
Thanks. I have applied Shlomi's patches to blead and am now smoking them on maint-5.18 for application before v5.18.1.
-- rjbs
Thanks. I have applied Shlomi's patches to blead and am now smoking them on maint-5.18 for application before v5.18.1.
-- rjbs
@rjbs - Status changed from 'open' to 'resolved'
On Mon\, 10 Jun 2013 15:24:45 -0700 "Ricardo SIGNES via RT" \perlbug\-comment@​perl\.org wrote:
Thanks. I have applied Shlomi's patches to blead and am now smoking them on maint-5.18 for application before v5.18.1.
Thanks for applying the patches.
Regards\,
Shlomi Fish
--
Shlomi Fish http://www.shlomifish.org/ Interview with Ben Collins-Sussman - http://shlom.in/sussman
One of Buffy the Vampire Slayerâs episodes took place in the NSA headquarters\, but had to be destroyed\, because all of the test audience had uncontrollable panic attacks. â http://www.shlomifish.org/humour/bits/facts/NSA/
Please reply to list if it's a mailing list post - http://shlom.in/reply .
Migrated from rt.perl.org#118169 (status was 'resolved')
Searchable as RT118169$