Debugging with GDB (September 2007)

Chapter 21: The gd b/mi Interface 285
nr-rows nr-cols [ aschar ]
where:
address An expression s pecifying the address of the first memory word to be read.
Complex expressions containing embedded white space should be quoted using
the C convention.
word-format
The format to be used to print the memory words. The notation is the same
as for GDB print command (see Section 8.4 [Output formats], page 66).
word-size
The size of each memory word in bytes.
nr-rows The numbe r of rows in the output table.
nr-cols The numbe r of columns in the output table.
aschar If present, indicates that each row should include an ascii dump. The value
of aschar is used as a padding character when a byte is not a member of the
printable ascii character set (printable ascii characters are those w hose code
is between 32 and 126, inclusively).
byte-offset
An offset to add to the address before fetching mem ory.
This command displays memory contents as a table of nr-rows by nr-cols words, each
word being word-size bytes. In total, nr-rows * nr-cols * word-size bytes are read
(returned as total-bytes’). Should less than the requested number of bytes be returned
by the target, the missing words are identified using N/A’. The number of bytes read from
the target is returned in nr-bytes and the starting address used to read memory in addr’.
The address of the next/previous row or page is available in next-row and prev-row’,
next-page and prev-page’.
GDB command
The corresponding GDB command is x’. gdbtk has gdb_get_mem memory read com-
mand.
Example
Read six bytes of memory starting at bytes+6 but then offset by -6 bytes. Format as
three rows of two columns. One byte per word. Display each word in hex.
(gdb)
9-data-read-memory -o -6 -- bytes+6 x 1 3 2
9^done,addr="0x00001390",nr-bytes="6",total-bytes="6",
next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396",
prev-page="0x0000138a",memory=[
{addr="0x00001390",data=["0x00","0x01"]},
{addr="0x00001392",data=["0x02","0x03"]},
{addr="0x00001394",data=["0x04","0x05"]}]
(gdb)