Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Replaying debugger commands from history

by LanX (Saint)
on Nov 20, 2019 at 15:59 UTC ( [id://11108944]=note: print w/replies, xml ) Need Help??


in reply to Replaying debugger commands from history

Sure!

Have a look at the docs in perldebug#Debugger-Customization concerning

 @DB::typeahead

like

sub afterinit { push @DB::typeahead, "b 4", "b 6"; }

IIRC it should be either settable

  • in .perldb
  • or in the -e'' command line option at startup
  • (update) or even inside your debugged code inside BEGIN

HTH! :)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^2: Replaying debugger commands from history
by likbez (Sexton) on Nov 21, 2019 at 23:43 UTC
    Hi LanX,

    Yes, that solves my problem.

    I can generate this line dynamically from history before entering the debugger to get to some deeply nested call.

    Thanks a lot !!!

    sub afterinit { push @DB::typeahead, "b 4", "b 6"; }
    As I discovered today this trick also works from inside the debugger:
    DB<1> push @DB::typeahead, 'c 7','n','c' auto(-3) DB<2> c 7 main::(escape_from_deeply_nested_calls.pl:7): 7: say "\nProgram ended"; auto(-2) DB<3> n d1e1f1f2f3f4f5f6f7f8f9f10-f11-f9-f8-f7-f6-f5-f4-f3-f2-f1-f0-e1-d1 Program ended main::(escape_from_deeply_nested_calls.pl:8): 8: say "Failure_code is $global_failure"; auto(-1) DB<3> c Failure_code is 14 Debugged program terminated. Use q to quit or R to restart,

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11108944]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-24 22:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found