Services - tools - models - for embedded software development
Embecosm divider strip
Prev  Next

3.2.6.  The step Command

The GDB step command to step the target a single high level instruction is similar to the stepi instruction, and works by using multiple s packets. However additional packet exchanges are also required to provide information to be displayed about the high level data structures, such as the stack.

The RSP packet exchanges to implement the GDB step command are shown as a sequence diagram in Figure 3.5. In this example the first instruction of a C main () function is executed.

RSP packet exchanges for the GDB step command

Figure 3.5.  RSP packet exchanges for the GDB step command


The exchanges start similarly to the stepi, although, since this is not the first step, there are no vCont? or Hc packets.

The high level language step is mapped by the client GDB session into a series of s packets, after each of which the register cache is refreshed by a g packet.

After the step, are a series of reads of data words, using m packets. The first group are from the code. This is the first execution in a new function, and the frame analysis functions of the GDB client are analyzing the function prologue, to establish the location of key values (stack pointer, frame pointer, return address).

The second group access the stack frame to obtain information required by GDB. In this example the return address from the current stack frame.

Through this exchange, the GDB client shows the following output:

(gdb) step
main () at hello.c:41
41        simputs( "Hello World!\n" );
(gdb) 
	
Embecosm divider strip