Debugging with GDB (September 2007)
290 Debugging with GDB
21.7 gdb/mi program control
Program termination
As a result of execution, the inferior program can run to completion, if it doesnot en-
counter any breakpoints. In this case the output will include an exit code, if the program
has exited exceptionally.
Examples
Program exited normally:
(gdb)
-exec-run
^running
(gdb)
x = 55
*stopped,reason="exited-normally"
(gdb)
Program exited exceptionally:
(gdb)
-exec-run
^running
(gdb)
x = 55
*stopped,reason="exited",exit-code="01"
(gdb)
Another way the program can terminate is if it receives a signal such as SIGINT. In this
case, gdb/mi displays this:
(gdb)
*stopped,reason="exited-signalled",signal-name="SIGINT",
signal-meaning="Interrupt"
The -exec-abort com mand
Synopsis
-exec-abort
Kill the inferior running program.
GDB command
The corresponding GDB command is ‘kill’.
Example
N.A.