禁用特定命令的gdb输出

时间:2017-06-13 14:27:07

标签: gdb

我想在gdb中运行以下命令:

while 1
x $pc
stepi
end

但我不想输出stepi命令。有没有办法只禁用stepi命令输出?

1 个答案:

答案 0 :(得分:0)

您可以尝试gdbpython

while True:
    gdb.execute("x/i $pc") # you can see the output on terminal
    gdb.execute("stepi", to_string=True) # so that you cannot see its output
    # some stop criteria here?

像这样输入gdb:

python
while True:
    gdb.execute("x/i $pc")
    gdb.execute("stepi", to_string=True)
end