develooper Front page | perl.perl5.porters | Postings from March 2000

Many more debugger bugs!

From:
Tom Christiansen
Date:
March 14, 2000 15:53
Subject:
Many more debugger bugs!
Message ID:
5510.953078003@chthon
+-------------+
| Here's one: |
+-------------+

    Loading DB routines from perl5db.pl version 1.07
    Editor support available.

    Enter h or `h h' for help, or `man perldebug' for more help.

    main::(/tmp/fixaliases:1):      while ($cmd = <>) { 
      DB<1> c
    ^C^C^C^C^C^C^C^C

Whoops!  Hello?  TAP TAP TAP.  Is this thing turned on?  Could I
please come back to the debugger?  Pretty please?  Hello?  Is there
anybody there?

Obivously, it's doing the wrong thing with signals.  

+-------------+
| Here's two: |
+-------------+

    % cat /tmp/sig
    sub main { while (<>) { print } } 
    $SIG{INT} = sub { die "SIGINT\n" };
    eval q{ main() };
    exit unless $@;
    if ($@ && $@ ne "SIGINT\n") { die "panic: UNEXPECTED EXCEPTION ``$@''" } 
    else                        { print "Good enough.\n"; exit;            }

    % perl /tmp/sig
    blah 
    blah 
    ^CGood enough.

    % perl -d /tmp/sig

    Loading DB routines from perl5db.pl version 1.07
    Editor support available.

    Enter h or `h h' for help, or `man perldebug' for more help.

    main::(/tmp/sig:2):     $SIG{INT} = sub { die "SIGINT\n" };
    blah
    blah
    ^Cpanic: UNEXPECTED EXCEPTION ``SIGINT
            main::__ANON__[/tmp/sig:2]('Term::Cap=HASH(0x1048c0)', 'Term::Cap=HASH(0x1048c0)', undef, 'INT') called at /tmp/sig line 1
            main::main(undef, 1, undef) called at (eval 4)[/tmp/sig:3] line 1
            eval ' main() 
    ;' called at /tmp/sig line 3
    '' at /tmp/sig line 5, <> line 1.
    Debugged program terminated.  Use 

Yup, it's yet another SIGDIE bug.  Why can't these freaks keep their
fricking hands off my exceptions?  I feel violated every time they do
this to me, and here I find that the debugger has the same stoopid bug.

+---------------+
| Here's three: |
+---------------+

      DB<1> $DB::alias{darn} = 's/whoops/' 

      DB<2> darn
    Substitution replacement not terminated at (eval 4)[/usr/local/lib/perl5/5.6.0/perl5db.pl:514] line 1, <IN> line 2.
	    eval '$cmd =~ s/whoops/
    ;' called at /usr/local/lib/perl5/5.6.0/perl5db.pl line 514
	    DB::DB called at -e line 1

What is all that noise about?  


+--------------+
| Here's four: |
+--------------+

      DB<1> = home print(glob("~"))
    home = print(glob("~"))
      DB<2> home
    String found where operator expected at (eval 5)[/usr/local/lib/perl5/5.6.0/perl5db.pl:514] line 1, at end of line
	    eval '$cmd =~ s~home~print(glob("~"))~
    ;' called at /usr/local/lib/perl5/5.6.0/perl5db.pl line 514
	    DB::DB called at -e line 1
	    (Missing operator before ?)
	    eval '$cmd =~ s~home~print(glob("~"))~
    ;' called at /usr/local/lib/perl5/5.6.0/perl5db.pl line 514
	    DB::DB called at -e line 1
    Can't find string terminator "/" anywhere before EOF at (eval 5)[/usr/local/lib/perl5/5.6.0/perl5db.pl:514] line 1, <IN> line 5.
	    eval '$cmd =~ s~home~print(glob("~"))~
    ;' called at /usr/local/lib/perl5/5.6.0/perl5db.pl line 514
	    DB::DB called at -e line 1

And that's just insane.  

The initial problem problem with these last two is that aliases are
handled completely incorrectly.  I'll fix this by changing how aliases
are done.  

But the $SIG{INT} stuff is nasty and wrong, and will be less fun
to fix.  This $SIG{__DIE__} screw-up is way, way over the top.   You
wonder why I want it gone, when even its most bellicose proponent
can't figure out how to use it properly?  

I guess I'll fix these this, too.  Blah.

--tom



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