How to set breakpoint on a particular file in Perl program?

前端 未结 2 906
南旧
南旧 2021-02-02 10:23

My Perl program looks like:

foo/
foo/bar/
for/bar/test.pm
foo.pm
foo/bar.pm
test.pl

and use perl test.pl to start the program. I

2条回答
  •  执念已碎
    2021-02-02 10:58

    Just use the fully qualified name of the sub as the argument to b:

    b foo::bar::test::subname
    

    Example:

    $ perl -d -e'use CGI; CGI->new'
    ...
    main::(-e:1):   use CGI; CGI->new
      DB<1> b CGI::new
      DB<2> r
    CGI::new(.../CGI.pm:337):
    337:      my($class,@initializer) = @_;
      DB<2> q
    

提交回复
热议问题