gdb scripting: execute commands at selected breakpoint

前端 未结 1 1203
[愿得一人]
[愿得一人] 2020-12-01 17:41

I\'d like to predefine some breakpoints in a gdb script and to invoke some special commands at these breakpoints and afterwards to automatically continue the program executi

相关标签:
1条回答
  • 2020-12-01 18:36

    You should take a look at the command command, which enables you to add gdb commands as a breakpoint is hit. See the breakpoint command list section of the gdb manual.

    For example:

    break someFunction
    commands
    print var1
    end
    

    will, when the breakpoint on someFunction is hit, automatically print var1.

    0 讨论(0)
提交回复
热议问题