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

Perl -d 调试perl程序

发布时间:2020-12-16 00:32:59 所属栏目:大数据 来源:网络整理
导读:在控制台输入perldoc perldebug即可如何得到如何调试perl程序的文档。 其中重要的命令如下: p expr????? Same as "print {$DB::OUT} expr" in the current package. In ??????????????? particular,because this is just Perl's own "print" ??????????????

在控制台输入perldoc perldebug即可如何得到如何调试perl程序的文档。


其中重要的命令如下:


p expr????? Same as "print {$DB::OUT} expr" in the current package. In
??????????????? particular,because this is just Perl's own "print"
??????????????? function,this means that nested data structures and objects
??????????????? are not dumped,unlike with the "x" command.

???????????

x [maxdepth] expr
??????????????? Evaluates its expression in list context and dumps out the
??????????????? result in a pretty-printed fashion.


T?????????? Produce a stack backtrace. See below for details on its
??????????????? output.


s [expr]??? Single step. Executes until the beginning of another
??????????????? statement,descending into subroutine calls. If an
??????????????? expression is supplied that includes function calls,it too
??????????????? will be single-stepped.

n [expr]??? Next. Executes over subroutine calls,until the beginning of
??????????????? the next statement. If an expression is supplied that
??????????????? includes function calls,those functions will be executed
??????????????? with stops before each statement.

r?????????? Continue until the return from the current subroutine. Dump
??????????????? the return value if the "PrintRet" option is set (default).


<CR>??????? Repeat last "n" or "s" command.


L [abw]???? List (default all) actions,breakpoints and watch
??????????????? expressions


l?????????? List next window of lines.

l line????? List a single line.

??? l subname?? List first window of lines from subroutine. *subname* may be
??????????????? a variable that contains a code reference.


b?????????? Sets breakpoint on current line

b [line] [condition]
??????????????? Set a breakpoint before the given line. If a condition is
??????????????? specified,it's evaluated each time the statement is
??????????????? reached: a breakpoint is taken only if the condition is
??????????????? true. Breakpoints may only be set on lines that begin an
??????????????? executable statement. Conditions don't use "if":

??????????????????? b 237 $x > 30
??????????????????? b 237 ++$count237 < 11
??????????????????? b 33 /pattern/i

b subname [condition]
??????????????? Set a breakpoint before the first line of the named
??????????????? subroutine. *subname* may be a variable containing a code
??????????????? reference (in this case *condition* is not supported).

c [line|sub]
??????????????? Continue,optionally inserting a one-time-only breakpoint at
??????????????? the specified line or subroutine.


q or ^D???? Quit. ("quit" doesn't work for this,unless you've made an
??????????????? alias) This is the only supported way to exit the debugger,
??????????????? though typing "exit" twice might work.

??????????????? Set the "inhibit_exit" option to 0 if you want to be able to
??????????????? step off the end the script. You may also need to set
??????????????? $finished to 0 if you want to step through global
??????????????? destruction.

R?????????? Restart the debugger by "exec()"ing a new session. We try to
??????????????? maintain your history across this,but internal settings and
??????????????? command-line options may be lost.

??????????????? The following setting are currently preserved: history,
??????????????? breakpoints,actions,debugger options,and the Perl
??????????????? command-line options -w,-I,and -e.


w expr????? Add a global watch-expression. Whenever a watched global ??????????????? changes the debugger will stop and display the old and new ??????????????? values. W expr????? Delete watch-expression W *???????? Delete all watch-expressions.

(编辑:李大同)

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

    推荐文章
      热点阅读