加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

perl – 如何调试自定义调试器?

发布时间:2020-12-16 06:13:55 所属栏目:大数据 来源:网络整理
导读:我写了一个自定义调试器,如 perldebguts所述.但是我的调试器代码有问题,所以我想逐行遍历我的DB :: DB()和DB :: sub()例程来隔离问题. 我想我可以通过将 $^D 设置为1 When the execution of your program reaches a point that can hold a breakpoint,the DB
我写了一个自定义调试器,如 perldebguts所述.但是我的调试器代码有问题,所以我想逐行遍历我的DB :: DB()和DB :: sub()例程来隔离问题.

我想我可以通过将$^D设置为1<<<<<<<<<<<<<<<<<<<<<<<<<

When the execution of your program reaches a point that can hold a breakpoint,the DB::DB() subroutine is called if any of the variables $DB::trace,$DB::single,or $DB::signal is true. These variables are not localizable. This feature is disabled when executing inside DB::DB(),including functions called from it unless $^D & (1<<30) is true.

When execution of the program reaches a subroutine call,a call to &DB::sub (args) is made instead,with $DB::sub holding the name of the called subroutine. (This doesn’t happen if the subroutine was compiled in the DB package.)

(重点补充)

IRC#perl-help频道的人说用$^ D& (1<<<<<<<<<<<<<<<<<<<<<<<<<<< 30) 如何逐步跟踪DB :: DB()和DB :: sub()子例程的执行情况? UPD
根据下面的答案.当设置$^ D | =(1<<<< 30)标志时,这允许我调试在DB命名空间之外定义的调试器命令,但这不是问题的答案:如何在执行DB ::内部时禁用该功能D B?

解决方法

这是我想要调试的自定义调试器 Devel::DebugHooks.

当我从调试器运行这个表达式时,$^ D | =(1<<<<<<<<<<<<<<<<<<<<<<<<<<<<

This feature is disabled when executing inside DB::DB(),including functions called from it unless $^D & (1<<30) is true

来自DOC的这句话只会令人困惑.在DB :: DB()内部执行时,该功能未被禁用,除非$^ D& (1 << <30)是真的.当$^ D& amp;&amp ;; (1 << <30)是真的

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读