• (Resolved) Re: perl debugger broken?

    From Mike Scott@21:1/5 to Mike Scott on Thu Nov 9 10:40:31 2023
    XPost: alt.os.linux.mint

    On 08/11/2023 21:04, Mike Scott wrote:
    Hi all.

    I've found that the perl debugger 'v' command fails since I upgraded a
    while ago.

    It's OK on Mint 20.3 (perl 5.30) but broken on Mint 21 (perl 5.34).

    I get this:
    Enter h or 'h h' for help, or 'man perldebug' for more help.

    main::(/tmp/t.pl:1):    print "hello\n";
      DB<1> v

    Undefined subroutine &DB::cmd_l called at
    .....
    Indeed, cmd_l is not defined in the current perl5db.pl script.



    I find this really weird; somehow someone's gratuitously removed a
    complete 4-line subroutine and nobody noticed.

    Anyway, I copied the relevant lines from an older version, and it seems
    to work now.

    In perl5db.pl, add
    sub cmd_l {
    my (undef, $line) = @_;

    return _cmd_l_main($line);
    }

    after the (badly worded) comment
    ## end sub cmd_l


    (X-posted to c.l.p.misc in case anyone there is interested.)


    --
    Mike Scott
    Harlow, England

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Keith Thompson@21:1/5 to Mike Scott on Thu Nov 9 13:14:33 2023
    XPost: alt.os.linux.mint

    Mike Scott <usenet.16@scottsonline.org.uk.invalid> writes:
    On 08/11/2023 21:04, Mike Scott wrote:
    Hi all.
    I've found that the perl debugger 'v' command fails since I upgraded
    a while ago.
    It's OK on Mint 20.3 (perl 5.30) but broken on Mint 21 (perl 5.34).
    I get this:
    Enter h or 'h h' for help, or 'man perldebug' for more help.
    main::(/tmp/t.pl:1):    print "hello\n";
      DB<1> v
    Undefined subroutine &DB::cmd_l called at
    .....
    Indeed, cmd_l is not defined in the current perl5db.pl script.

    I find this really weird; somehow someone's gratuitously removed a
    complete 4-line subroutine and nobody noticed.

    Anyway, I copied the relevant lines from an older version, and it
    seems to work now.

    In perl5db.pl, add
    sub cmd_l {
    my (undef, $line) = @_;

    return _cmd_l_main($line);
    }

    after the (badly worded) comment
    ## end sub cmd_l


    (X-posted to c.l.p.misc in case anyone there is interested.)

    This seems to be the relevant commit in https://github.com/perl/perl5 :

    commit b7a96fc9f5394c34d86d8b476ef4293f81ce341b
    Author: [omitted]
    Date: 2020-03-31 16:45:04 +1100

    fix `l $var` where $var is a lexical variable

    As with `i $obj` the DB::Obj in the call stack prevented DB::eval
    from compiling/executing in the context of the debugged code.

    I've omitted the author's name, but it's easy enough to look up.
    The commit is over 5000 lines. I haven't studied the changes.

    `sub cmd_l` is present in 5.33.0, absent in 5.33.1 and later and in
    5.34.0 and later.

    --
    Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
    Will write code for food.
    void Void(void) { Void(); } /* The recursive call of the void */

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)