Search code examples
gdbbreakpoints

gdb: break vs run


Let's say I set a breakpoint with break my_func in gdb, then type run. gdb executes the code until it hits the breakpoint. But what happens when I hit run again?

Will gdb continue into the breakpoint code, or will it skip past the breakpoint, or will it restart the code from line 1?


Solution

  • But what happens when I hit run again?

    The program is restarted.

    If you want to "step over the breakpoint" and continue execution, use continue command.