Debugging with GDB (September 2007)
296 Debugging with GDB
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 c ommand. 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"