在GDB中,用户可以定义一些在遇到断点时自动运行的操作。例如,
b foo.cpp:100
comm 1
p x
end
pdb是否具有类似的功能?
答案 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