开发者

gdb command file scripting: wait for breakpoint supported?

开发者 https://www.devze.com 2023-02-17 22:17 出处:网络
Im debugging quite a complex program with lots of queues, each having a relatively short timeout period set.

Im debugging quite a complex program with lots of queues, each having a relatively short timeout period set. I cannot debug reliable in gdb's 'manual' command line mode, because timeouts are triggered when I type commands to slowly.

I don't like the idea of extending all the queue's timeouts, as this would make things really messy. (This sounds like the design itself is arguable, I know...)

I'd really like to use the gdb 'scripting' feature, but I haven't found a good tutorial for this.

Could anyone tell me if this is possible in a gdb "command file" script:

So basically my question is: can I wait for a breakpoint inside a gdb command file script?


Answering my own question: I had success using hooks. My command file looks like this:

[initialization code]

define hook-stop
[commands to be executed at breakpoint]
end

set breakpoint pending on
b my_breakpoint_function
r
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号