perl - 从 .perldb 初始化文件设置断点
问题描述
我正在试验.perldb
rc 文件并尝试设置断点。这是我用于测试的一个小示例脚本(p.pl):
use feature qw(say);
use strict;
use warnings;
say "Line 5";
say "Line 6";
say "Line 7";
.perldb
然后,我在当前目录中创建了以下文件:
parse_options("NonStop=1");
sub afterinit { push @DB::typeahead, "b 7" }
(请注意,此文件不应由您自己以外的其他人(即:)拥有写权限,chmod 644 .perldb
否则调试器将不会加载它)。然后我在调试器下运行脚本:
$ perl -d p.pl
Line 5
Line 6
Line 7
正如所见,第 7 行的断点不受尊重。这里有什么问题?
解决方案
将您的“.perldb 文件”更改为
#parse_options("NonStop=1");
sub afterinit { push @DB::typeahead, ("b 7", "c") }
应该做的工作。
$ perl -d t.pl
Loading DB routines from perl5db.pl version 1.51
Editor support available.
Enter h or 'h h' for help, or 'man perldebug' for more help.
main::(t.pl:5): say "Line 5";
auto(-2) DB<1> b 7
auto(-1) DB<2> c
Line 5
Line 6
main::(t.pl:7): say "Line 7";
DB<2> l
7==>b say "Line 7";
推荐阅读
- nestjs - 如何在 NestJS 中使用 Fastify 策略作为 AuthGuards?
- php - 如何将变量传递给mailgun默认电子邮件模板
- java - 如何从 Firestore 中检索片段中的数据
- javascript - Publisher div 未显示在 Ionic 3 的 opentok cordova 插件中
- mongodb - MongoDB触发REST API springboot
- maven - 解压并更改 EAR 部署的捆绑包名称
- woocommerce - 如果选择货币切换器,我需要我的结帐页面帐单地址应该自动更新一次
- jquery - Ajax jQuery 调用上的 415 错误 - Spring MVC 控制器
- arrays - Julia:我可以在 for 循环的迭代中更新和存储相同的数组吗?
- javascript - 如何避免角度 PUT 方法中的 CORS 策略错误