Skip to content
Advertisement

How can I use the Perl debugger’s *supported* editor?

The Perl debugger always says: “Editor support available”. I believe every one can see this, but how can I use it?

my-computer$ perl -de2

Loading DB routines from perl5db.pl version 1.33
Editor support available.

Enter h or `h h' for help, or `man perldebug' for more help.

main::(-e:1):   2
  DB<1>

By the way, I got the above prompt on a Linux/UbuntuĀ 11.04 (Natty Narwhal) machine.

Advertisement

Answer

The message is a little confusing. It’s telling you it can support running inside an editor, not that there is a special Perl debugger editor.

The Perl debugger can detect if it’s talking to a terminal or if it’s running inside an editor. This controls a number of things, the biggest is whether the debugger prints anything or leaves it up to the editor to handle the display. If you’re really curious, look through the debugger code for $slave_editor.

Why does it feel the need to inform the user of this? I did a little digging and the debugger used to only support Emacs debugging. It’s a bit more useful to inform the user “Emacs support available” than that some editor somewhere will work with the debugger. The Emacs message came in with the first version of the debugger sprung fully formed from the head of Ilya.

The Perl debugger is also really three entities. The perl5db.pl script, the DB API, and the debugging hooks in the language itself which those two use. An editor may use perl5db.pl, or it may talk directly using DB.

There are a few editors which can hook into the Perl debugger. One is Emacs which you can start by opening a Perl program in Emacs and using M-x perldb. Komodo and Padre also have debugger support.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement