Reads data from a target system memory space
readmem id vaddr len
readmem sends a request to read data from the memory space of the target system by way of the dbgif tool. The 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 vaddr is the starting location to read. The len argument is the number of bytes to be read, starting from the specified location.
The contents of memory are displayed (in hexadecimal) on stdout as a sequence of byte values.
For example, this command "readmem 3 0x80001000 20" produces this output:
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
Before executing this command, you must ensure that the dbgif program is running and that the METHOD environment variable is set to indicate whether this is a request for the R4300 CPU or the RCP co-processor. The value zero represents the CPU and the number one represents the RCP. In csh, this is accomplished by specifying:
setenv METHOD 0
If METHOD is set to 1 and the co-processor is 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.
In the event of a communications failure, the program will dump core. If that happens, you must remove the core file manually.
dbgif, listthreads, writeword
1999/04/30 Changed Format