Debugging with GDB (September 2007)
292 Debugging with GDB
GDB command
The corresponding GDB command is ‘finish’.
Example
Function returning void.
-exec-finish
^running
(gdb)
@hello from foo
*stopped,reason="function-finished",thread-id="1",frame=addr="0x000029ec",
func="main",args=[],file="hello.c",line="7file="hello.c",line="7"}
(gdb)
Function returning other than void. The name of the internal GDB variable storing the
result is printed, together with the value itse lf.
-exec-finish
^running
(gdb)
*stopped,reason="function-finished",thread-id="1",
frame=addr="0x000107b0",func="foo",
args=[name="a"],name="b",
file="recursive2.c",line="14"},
gdb-result-var="$1",return-value="0"
(gdb)
The -exec-interrupt command
Synopsis
-exec-interrupt
Asynchronous command. Interrupts the background execution of the target. Note how
the token associated with the stop message is the one for the execution command that has
been interrupted. The token for the interrupt itself only appears in the ‘^done’ output. If
the user is trying to interrupt a non-running program, an error me ss age w ill be printed.
GDB command
The corresponding GDB command is ‘interrupt’.
Example
(gdb)
111-exec-continue
111^running