pdb是否有" comm"命令像gdb?

时间:2017-06-02 00:37:53

标签: python pdb

在GDB中,用户可以定义一些在遇到断点时自动运行的操作。例如,

 b foo.cpp:100
 comm 1
 p x
 end

pdb是否具有类似的功能?

1 个答案:

答案 0 :(得分:1)

是。在https://docs.python.org/2/library/pdb.html中,您可以找到:

commands [bpnumber]
  Specify a list of commands for breakpoint number bpnumber. The commands themselves appear on the following lines. Type a line containing just ‘end’ to terminate the commands