如何在pdb(ipdb)中找到断点编号? [英] How to find the breakpoint numbers in pdb (ipdb)?
问题描述
尝试查找如何执行ipdb(或pdb)命令,例如 disable
.
Trying to find how to execute ipdb (or pdb) commands such as disable
.
在 disable
上调用 h
命令说
禁用bpnumber [bpnumber ...]禁用以空格分隔的列表形式给出的断点bp的数字.
disable bpnumber [bpnumber ...] Disables the breakpoints given as a space separated list of bp numbers.
那我该如何获得这些bp数字?正在查看命令列表,却无法显示bp数字
So how whould I get those bp numbers? was looking through the list of commands and couldn't get any to display the bp numbers
break
, b
和 info断点
命令不执行任何操作,尽管在我的模块中我显然设置了1个这样的断点,如导入pdb;pdb.set_trace()
-与 ipdb
相同.此外,未定义 info
.
The break
, b
and info breakpoints
commands don't do anything, although in my module i clearly have 1 breakpoint set like this import pdb; pdb.set_trace( )
- same for ipdb
. Moreover info
is not defined.
pdb
中的 help
的输出:
文档化的命令(键入help):======================================= EOF bt cont启用跳转pp运行到c继续退出l q s直到别名cl d h
列表退出加强args清除调试帮助n
r tbreak w b命令禁用忽略下一个重新启动u whatis中断条件关闭j p
返回unalias
Documented commands (type help ): ======================================== EOF bt cont enable jump pp run unt a c continue exit l q s until alias cl d h
list quit step up args clear debug help n
r tbreak w b commands disable ignore next restart u whatis break condition down j p
return unalias where
其他帮助主题:========================== exec pdb
Miscellaneous help topics: ========================== exec pdb
未公开的命令:====================== retval rv
Undocumented commands: ====================== retval rv
对于 ipdb
:
文档化的命令(键入help):======================================= EOF bt cont enable jump pdef psource run unt ac
继续退出l pdoc q s直到别名cl
d h列出pfile退出升压args清除调试帮助n pinfo r tbreak w b
命令禁用忽略下一个pinfo2重新启动u whatis分解条件j p pp返回非别名
Documented commands (type help ): ======================================== EOF bt cont enable jump pdef psource run unt a c
continue exit l pdoc q s until alias cl
d h list pfile quit step up args clear debug help n pinfo r tbreak w b
commands disable ignore next pinfo2 restart u whatis break condition down j p pp return unalias where
其他帮助主题:========================== exec pdb
Miscellaneous help topics: ========================== exec pdb
未公开的命令:====================== retval rv
Undocumented commands: ====================== retval rv
我将模块另存为pb3.py,并在这样的命令行中执行它
I have saved my module as pb3.py and am executing it within the command line like this
python -m pb3执行确实会在断点处停止,但是在di pdb(ipdb)控制台中,指示的命令不会显示任何内容-或显示NameError
python -m pb3 The execution does indeed stop at the breakpoint, but within di pdb (ipdb) console, the commands indicated don't display anything - or display a NameError
如果需要更多信息,我会提供.
If more info is needed, i will provide it.
推荐答案
使用 break
命令.不要添加任何行号,它会列出所有行号而不是添加它们.
Use the break
command. Don't add any line numbers and it will list all instead of adding them.
这篇关于如何在pdb(ipdb)中找到断点编号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!