How to set breakpoints on future shared libraries with a command flag

后端 未结 3 1829
攒了一身酷
攒了一身酷 2020-11-29 16:16

I\'m trying to automate a gdb session using the --command flag. I\'m trying to set a breakpoint on a function in a shared library (the Unix equivalent of a DLL)

3条回答
  •  心在旅途
    2020-11-29 16:39

    Replying to myself, I'd like to give the answer that someone gave me on IRC:

    (gdb) apropos pending
    actions -- Specify the actions to be taken at a tracepoint
    set breakpoint -- Breakpoint specific settings
    set breakpoint pending -- Set debugger's behavior regarding pending breakpoints
    show breakpoint -- Breakpoint specific settings
    show breakpoint pending -- Show debugger's behavior regarding pending breakpoints
    

    And so set breakpoint pending on does the trick; it is used in cmds.gdb like e.g.

    set breakpoint pending on
    break :
    

提交回复
热议问题