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

3.2.4.  Examining Memory

All GDB commands which involve examining memory are mapped by the client to a series of m packets. Unlike registers, memory values are not cached by the client, so repeated examination of a memory location will lead to multiple m packets for the same location.

The packet exchanges to implement the GDB disassemble command for a simple function are shown as a sequence diagram in Figure 3.3. In this example the simputc () function is disassembled.

RSP packet exchanges for the GDB disassemble command

Figure 3.3.  RSP packet exchanges for the GDB disassemble command


The disassemble command in the GDB client generates a series of RSP m packets, to obtain the instructions required one at a time.

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

(gdb) disas simputc
Dump of assembler code for function simputc:
0x00001020 <simputc+0>: l.addi   r1,r1,-8
0x00001024 <simputc+4>: l.sw     0(r1),r2
0x00001028 <simputc+8>: l.addi   r2,r1,8
0x0000102c <simputc+12>:        l.sw     -4(r2),r3
0x00001030 <simputc+16>:        l.nop    4
0x00001034 <simputc+20>:        l.lwz    r2,0(r1)
0x00001038 <simputc+24>:        l.jr     r9
0x0000103c <simputc+28>:        l.addi   r1,r1,8
End of assembler dump.
(gdb)
	
Embecosm divider strip