aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2010-03-24 01:12:13 +0000
committerPedro Alves <palves@redhat.com>2010-03-24 01:12:13 +0000
commit4a5e7a5b0ae022b3cd116e64a45d84f8ad51bc0d (patch)
tree404569e9f22356306d6f5884aeb3c948d5e4861d /gdb/target.h
parent2280c721d82d1c3d80e5f9afa9714406c5f411a7 (diff)
downloadgdb-4a5e7a5b0ae022b3cd116e64a45d84f8ad51bc0d.zip
gdb-4a5e7a5b0ae022b3cd116e64a45d84f8ad51bc0d.tar.gz
gdb-4a5e7a5b0ae022b3cd116e64a45d84f8ad51bc0d.tar.bz2
gdb/
* remote.c (crc32): Constify `buf' parameter. (remote_verify_memory): New, abstracted out from... (compare_sections_command): ... this. Remove hardcoded target checks. (init_remote_ops): Install remote_verify_memory. * target.c (target_verify_memory): New. * target.h (struct target_ops) <to_verify_memory>: New field. (target_verify_memory): Declare.
Diffstat (limited to 'gdb/target.h')
-rw-r--r--gdb/target.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/target.h b/gdb/target.h
index 9e87440..0d16139 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -675,6 +675,13 @@ struct target_ops
right now, or in this debug session, or for this target -- return -1. */
int (*to_core_of_thread) (struct target_ops *, ptid_t ptid);
+ /* Verify that the memory in the [MEMADDR, MEMADDR+SIZE) range
+ matches the contents of [DATA,DATA+SIZE). Returns 1 if there's
+ a match, 0 if there's a mismatch, and -1 if an error is
+ encountered while reading memory. */
+ int (*to_verify_memory) (struct target_ops *, const gdb_byte *data,
+ CORE_ADDR memaddr, ULONGEST size);
+
int to_magic;
/* Need sub-structure for target machine related rather than comm related?
*/
@@ -1375,6 +1382,14 @@ extern int target_search_memory (CORE_ADDR start_addr,
extern int target_core_of_thread (ptid_t ptid);
+/* Verify that the memory in the [MEMADDR, MEMADDR+SIZE) range matches
+ the contents of [DATA,DATA+SIZE). Returns 1 if there's a match, 0
+ if there's a mismatch, and -1 if an error is encountered while
+ reading memory. Throws an error if the functionality is found not
+ to be supported by the current target. */
+int target_verify_memory (const gdb_byte *data,
+ CORE_ADDR memaddr, ULONGEST size);
+
/* Routines for maintenance of the target structures...
add_target: Add a target to the list of all possible targets.