How can I make gdb stop at a breakpoint after the loop has been executed n times several times

I want to stop execution when the loop has been executed n times. I do not want to use a conditional breakpoint using the loop-counter value, because the initial value of the loop counter differs at different run times.

+3
source share
1 answer

You need to use the command ignore. Set a breakpoint at an appropriate place in your loop, and then use ignoreto specify how many times to ignore the breakpoint.

Syntax according to help ignore:

- N COUNT. - N COUNT".

+4

All Articles