Skip to content

Subroutine breakpoints should really be in the subroutine. #24

@rocky

Description

@rocky

From perl #1726. Consider:

#!perl
use strict;
use warnings;
sub problem {
    $SIG{__DIE__} = sub {
    die "<b problem> will set a break point here.\n"
    };
    warn "This line will run even if you enter <c problem>.\n";
}

problem();
exit(0);

(This is example/sub-brkpt-bug.pl in git and this may be related to a Module::Signature bug in example/signature.pl)

Setting a breakpoint on problem sets the breakpoint on the "die" statement which is wrong. It so happens that the first breakable line is the line after that which contains };.

Possibly the best fix is to run the breakpoint from &DB::sub rather than try to convert the subroutine into a line number.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions