The -exec-finish command

Synopsis

-exec-finish

Asynchronous command. Resumes the execution of the inferior program until the current function is exited. Displays the results returned by the function.

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 itself.

-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 message will be printed.

GDB command

The corresponding GDB command is 'interrupt'.

332 The GDB/MI Interface