我在emacs中使用perldb来调试Perl脚本(在Linux上).工作得很好,直到我调试一个分叉的脚本.如果我的脚本执行"fork",我得到这个:
######### Forked, but do not know how to create a new TTY. #########
Since two debuggers fight for the same TTY, input is severely entangled.
I know how to switch the output to a different window in xterms
and OS/2 consoles only. For a manual switch, put the name of the created TTY
in $DB::fork_TTY, or define a function DB::get_fork_TTY() returning this.
On UNIX-like systems one can get the name of a TTY for the given window
by typing tty, and disconnect the shell from TTY by sleep 1000000.
Run Code Online (Sandbox Code Playgroud)
我真的希望能够选择一个进程(父进程或子进程)并继续调试该进程,同时允许另一进程继续畅通无阻.伸展目标是一种明确地继续调试BOTH进程的方法,可能在emacs中为控件和代码窗口打开额外的帧.但是能够干净地继续调试其中一个将是一个巨大的胜利.
在perldb中有没有办法做到这一点?我试图按照这条消息中的建议,但无处可去.
或者我需要一些其他Perl调试工具?如果是后者,哪个Perl调试器为多进程调试提供了最好的支持?
如果您可以访问控制台和GUI桌面,请在xterm窗口中运行调试器.perl调试器与xterms非常无缝地工作,正如警告消息所暗示的那样.在创建新进程时,调试器将打开新的xterm窗口,您可以按任何顺序逐步执行任何进程.
在任何一种情况下,清除inhibit_exit标志对于调试多进程程序也很有帮助.跑
o inhibit_exit=0
Run Code Online (Sandbox Code Playgroud)
从调试器提示符.这样,当您生成一个运行Perl的新进程,并且没有理由在子进程内的任何位置中断时,子进程不会使用该Debugged program terminated. Use q to quit or R to restart ...消息中断调试器.
因为它很可能你的 xterm或类似下运行,你可能会受到什么样的“的xterm”是Perl调试的,而狭隘的观点咬伤。
它专门在寻找字符串“ xterm”。它想xterm在TERM环境变量中查看。不gnome-terminal。不xterm-256color。只是xterm。
运行:
TERM=xterm perl -d ...
Run Code Online (Sandbox Code Playgroud)
确保获得图片。在Perl调试器中进行了十分钟的抱怨之后,我才发现其中一个。
顺便说一句,生成大量xterm窗口似乎很高兴,并且似乎并不太擅长清理它们。