简体   繁体   English

我怎样才能使用 Perl 调试器的 *supported* 编辑器?

[英]How can I use the Perl debugger's *supported* editor?

The Perl debugger always says: "Editor support available". Perl 调试器总是说:“编辑器支持可用”。 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.顺便说一下,我在 Linux/ Ubuntu 11.04 (Natty Narwhal) 机器上得到了上述提示。

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.它告诉您它可以支持在编辑器内运行,而不是有一个特殊的 Perl 调试器编辑器。

The Perl debugger can detect if it's talking to a terminal or if it's running inside an editor. Perl 调试器可以检测它是在与终端对话还是在编辑器中运行。 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 .如果您真的很好奇,请查看$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 .我做了一些挖掘,调试器过去只支持 Emacs 调试 It's a bit more useful to inform the user "Emacs support available" than that some editor somewhere will work with the debugger.通知用户“Emacs 支持可用”比某处的某些编辑器将与调试器一起工作更有用。 The Emacs message came in with the first version of the debugger sprung fully formed from the head of Ilya . Emacs 消息伴随着从 Ilya 的头部完全形成的调试器的第一个版本进来。

The Perl debugger is also really three entities. Perl 调试器实际上也是三个实体。 The perl5db.pl script, the DB API , and the debugging hooks in the language itself which those two use. perl5db.pl 脚本、 DB API和这两个使用的语言本身中的调试挂钩。 An editor may use perl5db.pl, or it may talk directly using DB.编辑器可以使用 perl5db.pl,也可以直接使用 DB 进行对话。

There are a few editors which can hook into the Perl debugger.有几个编辑器可以连接到 Perl 调试器。 One is Emacs which you can start by opening a Perl program in Emacs and using Mx perldb .一种是 Emacs,您可以通过在 Emacs 中打开 Perl 程序并使用Mx perldbMx perldb Komodo and Padre also have debugger support. KomodoPadre也有调试器支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM