Cam
Cam

Reputation: 66

Make gdb exit on breakpoint

I'm using gdb to solve a binary bomb as part of a class. Every time we set the bomb off we lose points. I already have a break point on the function that explodes the bomb, but have accidentally stepped past it a couple times already and exploded the bomb. Is there a way to make gdb exit at a specific point rather than just break?

Upvotes: 2

Views: 384

Answers (1)

Employed Russian
Employed Russian

Reputation: 213937

You can attach commands to breakpoints. After you set breakpoint, e.g. #1, do this:

commands 1
quit
end

Upvotes: 2

Related Questions