I think your 'R' usage is quite handy. Here's another approach that can sometimes be useful:
% echo 'sub afterinit { $DB::single = 1 }' >> .perldb
That changes the Perl debugger's default to instead stop before running anything. See:
% cat .perldb sub afterinit { $DB::single = 1 } % cat debugMod.pl use LWP::UserAgent; warn "Done"; % perl -d debugMod.pl Loading DB routines from perl5db.pl version 1.33 ... main::CODE(0x43050c)(debugMod.pl:1): 1: use LWP::UserAgent; DB<1> s LWP::UserAgent::CODE(0x26c274c)(.../lib/LWP/UserAgent.pm:3): 3: use strict; DB<1> T $ = LWP::UserAgent::BEGIN() called from file `.../lib/LWP/UserAgent.pm +' line 3 $ = eval {...} called from file `.../lib/LWP/UserAgent.pm' line 3 $ = require 'LWP/UserAgent.pm' called from file `debugMod.pl' line 1 $ = main::BEGIN() called from ... $ = eval {...} called from ... DB<1>
Skipping over the loading of modules can be a pain, so I wouldn't recommend leaving this particular .perldb in place most of the time.
(FYI, I couldn't get this to work under Windows w/o first fixing some bugs in perl5db.pl or else I'd show how the file has to be named perldb.ini and other required differences there.)
- tye
In reply to Re: Using the debugger's R command to debug "hard" problems (.perldb)
by tye
in thread Using the debugger's R command to debug "hard" problems
by pemungkah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |