File tree 1 file changed +34
-0
lines changed
1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ Pdb: The Python Debugger Python调试器
2
+
3
+ h(elp): 打印当前版本 Pdb可用的命令
4
+
5
+ l(ist): 显示当前代码的部分上下文
6
+ l(ist) <line number> 显示指定行的上下文
7
+ l(ist) <line number1, line number2> 显示指定开始行到结束行的代码
8
+ w(here) 找出当前代码运行位置
9
+
10
+ u(p) 返回上个调用点
11
+ d(own) 返回下个调用点
12
+
13
+ a(rgs) 显示当前所有变量
14
+ p(rint) 打印表达式结果
15
+ pp 打印美化过的表达式结果
16
+
17
+ s(tep) 步进运行至下行代码(如果是调用函数,则运行至所调用函数的第一行)
18
+ n(ext) 运行至下行代码(如果是调用函数,会直接运行完此函数)
19
+ unt(il) 运行至当前代码端底部
20
+ r(eturn) 运行至return代码处
21
+ run <arg...> 重新运行程序(断点设置不会丢失)
22
+ c(ont(inue)) 运行程序直至遇到下一个断点
23
+ j(ump) lineno 跳转至指定程序行(如果是前行,则忽略中间行代码。如果是后退,状态重设为回退行状态)
24
+ [!]statement 运行python命令,比如!test='hello' 将会把test变量的值改变为hello
25
+
26
+ b(reak) <line number> 运行时设置断点
27
+ b(reak) <file name:line number> 运行时设置另一个文件的断点
28
+ b(reak) 显示断点情况
29
+ cl(ear) <break number> 删除断点
30
+ cl(ear) 删除断点
31
+ disable <break number> 将指定的断点失效(但存在)
32
+ enable <break number> 将指定的断点生效
33
+
34
+ q(uit): 直接退出调试
You can’t perform that action at this time.
0 commit comments