Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any work around to make perl debugger set break points on modules not yet loaded?

Tags:

debugging

perl

So that in future the break points take affect as soon as the target file is loaded. Otherwise the debugger hardly helps ...

main::(test.pl:7):      Class->new->go;
  DB<1> f Movie.pm
No file matching `Movie.pm' is loaded.
  DB<2> b Movie.pm:10
Subroutine main::Movie not found.

I know Movie.pm will be loaded and want to set a bp on its 10th line...

like image 233
new_perl Avatar asked Dec 27 '22 16:12

new_perl


2 Answers

I get round problems like this by manually typing the 'use' line into the debugger.

  DB<1> b LWP::Simple::get
Subroutine LWP::Simple::get not found.

  DB<2> use LWP::Simple


  DB<3> b LWP::Simple::get

  DB<4>

Does that help?

like image 100
Dave Cross Avatar answered Dec 31 '22 15:12

Dave Cross


Workaround: require the module when the debugger starts. You can put stuff in your .perldb rc file so you don't have to type/paste it every debugger session.

like image 32
daxim Avatar answered Dec 31 '22 14:12

daxim