This is the mail archive of the
gdb@sourceware.cygnus.com
mailing list for the GDB project.
memory verify
- To: gdb at sourceware dot cygnus dot com
- Subject: memory verify
- From: jtc at redback dot com (J.T. Conklin)
- Date: 30 Nov 1999 16:24:49 -0800
- Reply-To: jtc at redback dot com
I was thinking about the compare-sections command found in remote.c
and also adding a 'verify' attribute to my memory region code.
We need a target primitive for doing memory verifies. There are three
mechanisms that I can think of that can be used for this. Download a
chunk of memory and an address and have the target determine whether
they are the same; upload a chunk of memory at an address and have GDB
perform the comparison; and perform a CRC or strong hash function on
both the host and the target and compare the results.
The second can be trivially implemented using the target vector's
memory read function. However verify performance can be improved
if the target supplies either a compare memory or checksum command.
I propose the following new verify primitive:
/* Verify that memory at GDB address MYADDR and target address
MEMADDR are identical. This can be done by downloading the
memory region to the target and having it do the comparison;
uploading the memory region to GDB and having it do the
comparision; using a checksum, cyclic redundency check, or
cryptographic hash function; etc.
Return value, N, is one of the following:
0 - memory region is not identical.
1 - memory region is identical. */
int (*to_verify_memory) (CORE_ADDR memaddr, char *myaddr, int len);
If the target cannot handle a memory region of that SIZE, the function
is responsible for breaking it up into chunks.
--jtc
--
J.T. Conklin
RedBack Networks