python - 如何在 pdb (ipdb) 中找到断点号?

标签 python breakpoints ipdb

试图找到如何执行 ipdb(或 pdb)命令,例如 disable

disable 上调用 h 命令表示

disable bpnumber [bpnumber ...] Disables the breakpoints given as a space separated list of bp numbers.

那么我该如何获得这些 bp 数字呢?正在查看命令列表,无法显示 bp 编号

[编辑] breakbinfo breakpoints 命令不执行任何操作,尽管在我的模块中我显然设置了 1 个断点,如下所示 进口PDB; pdb.set_trace( ) - 与 ipdb 相同。此外,info 未定义。

pdbhelp的输出:

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

Miscellaneous 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 where

Miscellaneous 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/

相关文章:

java - 断点命中 Hashmap.put() 一个简单的 Hello World 程序

PHPStorm Xdebug 总是在第一行中断

c++ - 让 GDB 保存断点列表

python - 为什么在 cmd.Cmd 子类函数中退出 ipdb 会退出函数?

python-3.x - Python 调试器没有进入协程?

python - numpy.exponential 行为略有不同

python - 找不到页面 (404) 请求方法 : POST Request URL: http://127. 0.0.1:8000/accounts/signup/signup

Python将长字符串转换为不带单引号的列表

django - Ipdb 不显示 Django Nose 测试的输出

python - 为什么 SQLAlchemy 不创建串行列?