How do I stop a GDB execution without a breakpoint?
How to stop execution in GDB without a breakpoint
gdb
Related Topic
- How to make a GDB breakpoint only break after the point is reached a given number times
- How to set a conditional breakpoint in gdb, when char* x points to a string whose value equals “hello”
- C++ – Set breakpoint in C or C++ code programmatically for gdb on Linux
- How to remove a single breakpoint with GDB
- How to run a program with commandline arguments using GDB within a Bash script
- Printing all global variables/local variables
- Step out of current function with GDB
Best Answer
Just use a regular interrupt Ctrl-c will work just fine. GDB just forwards the
SIGINT
to the debugging process which then dies. GDB will catch the non-standard exit and break the process there, so you can still examine all the threads, their stacks and current values of variables. This works fine, though you would be better off using break points. The only time I find myself doing this is, if I think I've gotten into some sort of infinite loop.