试图找到如何执行 ipdb(或 pdb)命令,例如 disable
。
在 disable
上调用 h
命令表示
disable bpnumber [bpnumber ...] Disables the breakpoints given as a space separated list of bp numbers.
那么我该如何获得这些 bp 数字呢?正在查看命令列表,无法显示 bp 编号
[编辑]
break
、b
和 info breakpoints
命令不执行任何操作,尽管在我的模块中我显然设置了 1 个断点,如下所示 进口PDB; pdb.set_trace( )
- 与 ipdb
相同。此外,info
未定义。
pdb
中help
的输出:
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 whereMiscellaneous help topics: ========================== exec pdb
Undocumented commands: ====================== retval rv
对于ipdb
:
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 whereMiscellaneous help topics: ========================== exec pdb
Undocumented commands: ====================== retval rv
我已将我的模块保存为 pb3.py 并像这样在命令行中执行它
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
如果需要更多信息,我会提供。
最佳答案
使用break
命令。不要添加任何行号,它会列出所有行号而不是添加行号。
关于python - 如何在 pdb (ipdb) 中找到断点号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21582358/