readmem.1 1.68 KB
.TH readmem 1P local "Silicon Graphics, Inc."
.SH NAME
readmem \- read data from a target system memory
.SH SYNOPSIS
\f3readmem\f1 id vaddr len
.SH DESCRIPTION
The 
.B readmem
command sends a request to read data from the memory space of the
target system
via
.I dbgif.
The
.B id
is the thread number. Even though all threads share the same address
space, you must still specify a thread. This command is shared with
other debuggers in which threads may have different address spaces.
The virtual address
.B vaddr
is the starting location to read. The
.B len
argument is the number of bytes to be read, starting from the specified
location.
.PP
The contents of memory will be displayed (in hexadecimal) on
stdout as a sequence of byte values. For example, the command
"readmem 3 0x80001000 20" produces:
.nf

id 3 vaddr 0x80001000 len 20
0x80001000  44 84 b0 00 00 00 00 00 20 84 00 01 44 84 b8 00 
0x80001010  00 00 00 00 
.fi
.PP
Before execution of this command, the
.I dbgif
program must be running and the
.I METHOD
environment variable must be set to indicate whether this is a request for the
R4300 CPU or the coprocessor. The value zero represents the CPU and the number
one represents the RCP. In
.I csh,
this is accomplished by specifying
.IP
setenv METHOD 0
.PP
If METHOD is set to 1 and the coprocessor was running, the request will probably fail (as it should).
It is generally unwise to use METHOD 1 for this command anyway; all addresses
may be accessed from the CPU.
.SH SEE ALSO
dbgif(1P), listthreads(1P), writeword(1P)
.SH BUGS
In the event of a communications failure, the program will dump core. It
would be nice if it cleaned up after itself, but at present the core file
must be removed manually.