I work quit a bit with lib ReadLine and the lib Perl Readline.
Yet, the Perl debugger refuses to save the session command line history.
Thus, each time I invoke the debugger I lose all of my previous history.
Does anyone know how to have the Perl debugger save, and hopefully, append session history similar to the bash HISTORYFILE
?
The Perl debugger enables you to specify one or more statements to be executed whenever the program reaches a specified line. Such statements are known as line actions. The most common line actions are printing the value of a variable and resetting a variable containing an erroneous value to the value you want.
In Perl, the debugger is not a separate program the way it usually is in the typical compiled environment. Instead, the -d flag tells the compiler to insert source information into the parse trees it's about to hand off to the interpreter.
b-command is used to set a breakpoint in a program. Whenever a specified line is about to be executed, this command tells the debugger to halt the program.
The way I do this is by having the following line in my ~/.perldb
file:
&parse_options("HistFile=$ENV{HOME}/.perldb.hist");
Debugger commands are then stored in ~/.perldb.hist
and accessible across sessions.
Add parse_options("TTY=/dev/stdin ReadLine=0");
to .perldb, then:
rlwrap -H .perl_history perl -d ...
$ export PERLDB_OPTS=HistFile=$HOME/.perldb.history
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With