New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debugger: o warn=0 die=0 ignored #9421
Comments
From tye.mcqueen@gmail.comCreated by tyemq@cpan.orgIn the Perl debugger, the command "o warn=0 die=0" does nothing useful. This bug also applies to the latest 5.010 Perl I could conveniently find Here is a fix: Inline Patch--- 5.8.7/perl5db.pl 2005-09-27 10:45:51 -0700
+++ tye/perl5db.pl 2008-07-16 12:52:18 -0700
@@ -7703,6 +7703,8 @@
}
elsif ($prevwarn) {
$SIG{__WARN__} = $prevwarn;
+ } else {
+ undef $SIG{__WARN__};
}
} ## end if (@_)
$warnLevel;
@@ -7744,6 +7746,9 @@
elsif ($prevdie) {
$SIG{__DIE__} = $prevdie;
print $OUT "Default die handler restored.\n";
+ } else {
+ undef $SIG{__DIE__};
+ print $OUT "Die handler removed.\n";
}
} ## end if (@_)
$dieLevel; Perl Info
|
From p5p@spam.wizbit.beOn Wed Jul 16 13:02:26 2008, tye.mcqueen@gmail.com wrote:
Thanks for the bug report/patch. Can you also provide an example of where it doesn't behave as you Kind regards, Bram |
The RT System itself - Status changed from 'new' to 'open' |
From tye.mcqueen@gmail.comOn Sat, Jul 26, 2008 at 11:30 AM, Bram via RT <perlbug-followup@perl.org>wrote:
Um, just start the debugger, type "o warn=0 die=0" and then use warn or die If you are unable to notice the difference, then just simulate what it $SIG{__WARN__}= $SIG{__DIE__}= 0 and then try warn/die and see how unadorned the output is. Oh, to start the debugger, you can use "perl -debug". A full demonstration: ======================================== $ perl -debug Loading DB routines from perl5db.pl version 1.28 Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): bug ;' called at /usr/local/lib/perl5/5.8.7/perl5db.pl line 628 DB<2> o warn=0 ;' called at /usr/local/lib/perl5/5.8.7/perl5db.pl line 628 DB<4> $SIG{__WARN__}= 0 DB<5> warn "just this!\n" DB<6> q ======================================== Note that I've verified that this is broken in standard 5.8.7, 5.8.8, and ========================================
Loading DB routines from perl5db.pl version 1.28 Enter h or `h h' for help, or `perldoc perldebug' for more help. main::(-e:1): bug SetConsoleMode failed, LastError=|6| at DB<2> warn "just this\n" DB<3> o warn=1 DB<4> warn "junk!\n" ;' called at C:/strawberry-perl/perl/lib/perl5db.pl line 628 DB<5> o warn=0 DB<6> warn "Just this!\n" DB<7> q ======================================== Oh, the Strawberry Perl fix is simpler than the fix I proposed, just replace sub warnLevel { |
From p5p@perl.wizbit.beCiteren Tye McQueen <tye.mcqueen@gmail.com>:
I see. A small note tho: o warnLevel 0 is not intended to simulate What it is supposed to do is restore the previously set warning handler. Currently if no previously handler is set then o warnLevel 0 is a NUL op. I also feel that this is not very useful (but I don't use -d very
Note that you can set the default options via an rc file. (look at
May I ask at what Strawberry Perl you are looking? I just downloaded Strawberry Perl 5.10.0.1 and Strawberry Perl 5.8.8.1 sub warnLevel { Kind regards, Bram |
From tye.mcqueen@gmail.comOn Sat, Aug 2, 2008 at 10:45 AM, Bram <p5p@perl.wizbit.be> wrote:
No, it is supposed to restore the previous state of the warn handle. Having May I ask at what Strawberry Perl you are looking? Maybe I patched it myself long ago and forgot about it. Tye |
From @rgs2008/7/16 via RT Tye McQueen <perlbug-followup@perl.org>:
Thanks, applied as change #34312. |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#57016 (status was 'resolved')
Searchable as RT57016$
The text was updated successfully, but these errors were encountered: