I have two functions, func1 and func2, each with a breakpoint set.
Is it possible to have GDB stop on the func2 breakpoint iff the previous breakpoint hit was func1?
The best way to do this is to use commands in breakpoints.
You can direct GDB to execute certain commands (like, to increment a counter) when the two breakpoints are hit. The execution is halted conditionally based on the count of these variables/flags.
I found this information on this link. Please refer the same for further details. The article is very well-written with proper examples. Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With