如何在<中运行`x`命令。在perl调试器中执行操作?

编程入门 行业动态 更新时间:2024-10-20 05:32:04
本文介绍了如何在<中运行`x`命令。在perl调试器中执行操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在调试器中显示提示之前,我想输出一个半复杂的结构。最好的显示方法是使用 x 命令,但是该命令在该名称下不可用,或者可能不在范围内。

I'd like to get a semicomplex structure to be output before displaying the prompt in the debugger. The best way to display it is to use the x command, but the command isn't available under that name or perhaps it's not in scope.

我将如何实现?

推荐答案

请参见文档< ; rel = noreferrer> perldebug :

See the documentation for < [command] in perldebug:

< [命令]

设置在每个调试器提示之前执行的操作(Perl命令)。

Set an action (Perl command) to happen before every debugger prompt.

x 不是Perl命令。您要 {[命令] :

x is not a Perl command. You want { [command]:

{[命令]

设置在每个调试器提示之前执行的操作(调试器命令)。

Set an action (debugger command) to happen before every debugger prompt.

例如:

$ perl -de'$foo = { foo => "bar" }; print $foo' Loading DB routines from perl5db.pl version 1.37 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(-e:1): $foo = { foo => "bar" }; DB<1> { x $foo DB<2> n main::(-e:2): print $foo auto(-1) DB<2> x $foo 0 HASH(0x22af2c8) 'foo' => 'bar'

或者,使用您喜欢的转储模块(例如数据:: Dumper ,数据: :转储,数据::打印机):

Alternatively, use your favorite dumper module (e.g. Data::Dumper, Data::Dump, Data::Printer):

$ perl -de'$foo = { foo => "bar" }; print $foo' Loading DB routines from perl5db.pl version 1.37 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(-e:1): $foo = { foo => "bar" }; DB<1> use Data::Dumper DB<2> < print Dumper $foo DB<3> n main::(-e:2): print $foo $VAR1 = { 'foo' => 'bar' };

更多推荐

如何在&lt;中运行`x`命令。在perl调试器中执行操作?

本文发布于:2023-11-28 16:38:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643161.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:器中   命令   操作   如何在   amp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!