spraff
spraff

Reputation: 33385

Clear all/some breakpoints with gdb commands

I get into situations in gdb/ddd where there are too many breakpoints.

Sometimes I want to disable or remove all of them at once. Sometimes I want to disable or remove all except for one. I find the ddd breakpoints menu confusing and unreliable. How can I do this with a gdb command?

Upvotes: 38

Views: 47954

Answers (2)

AshleyWilkes
AshleyWilkes

Reputation: 821

To delete all the breakpoints, use delete command with no arguments; it can be abbreviated to del or d.

To disable all, use disable (with no arguments) to disable all breakpoints.

To disable all but one, use disable (with no arguments), but then do enable N, where N is the index of the breakpoint you want to keep.

Upvotes: 51

Employed Russian
Employed Russian

Reputation: 213385

I want to disable or remove all of them at once, or all except for one.

Use disable (with no arguments) to disable all breakpoints, followed by enable N, where N is the breakpoint you want to keep.

Upvotes: 20

Related Questions