Dharmendra
Dharmendra

Reputation: 394

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

I want to stop the execution, when the loop has been executed n number of times. I don't want to use the conditional breakpoint using value of loop-counter because initial value of loop-counter is different at different time of run.

Upvotes: 3

Views: 1344

Answers (1)

borrible
borrible

Reputation: 17376

You need to use the ignore command. Set a breakpoint at the relevant place in your loop and then use ignore to indicate how many times that the breakpoint is to be ignored.

Syntax, as per help ignore is:

Set ignore-count of breakpoint number N to COUNT. Usage is `ignore N COUNT'.

Upvotes: 4

Related Questions