Debugging with GDB Manual The GNU Source-Level Debugger (769148-001, March 2014)
The -exec-step Command
Synopsis
-exec-step
Asynchronous command. Resumes execution of the inferior program, stopping when the beginning
of the next source line is reached, if the next source line is not a function call. If it is, stop at the
first instruction of the called function.
GDB command
The corresponding GDB command is 'step'.
Example
Stepping into a function:
-exec-step
^running
(gdb)
~"2"
~"3"
*stopped,reason="end-stepping-range",thread-id="1",frame=addr="0x000029d0",
func="call",args=[name="a",name="b"],file="hello.c",line="15"
(gdb)
Regular stepping:
-exec-step
^running
(gdb)
~"2"
~"3"
*stopped,reason="end-stepping-range",thread-id="1",frame=addr="0x000029d8",
func="call",args=[name="a",name="b"],file="hello.c",line="16"
(gdb)
The -exec-step-instruction command
Synopsis
-exec-step-instruction
Asynchronous command. Resumes the inferior which executes one machine instruction. The output,
once GDB has stopped, will vary depending on whether we have stopped in the middle of a source
line or not. In the former case, the address at which the program stopped will be printed as well.
GDB command
The corresponding GDB command is 'stepi'.
Example
(gdb)
-exec-step-instruction
^running
(gdb)
~"2"
~"3"
*stopped,reason="end-stepping-range",thread-id="1",frame=addr="0x000029dc",
func="call",args=[name="a",name="b"],file="hello.c",line="16"
(gdb)
-exec-step-instruction
^running
256 The GDB/MI Interface