summaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2010-03-24 01:12:12 +0000
committerPedro Alves <pedro@codesourcery.com>2010-03-24 01:12:12 +0000
commitf11c56bbc0c6c69cf3caf6ad84f140ea6903dd78 (patch)
treefef5cda01926b95d764ce13b20593f638738e9fc /gdb/target.c
parent9be2d95a2989d38c648e9c0b910e5c7ed5f41225 (diff)
downloadgdb-f11c56bbc0c6c69cf3caf6ad84f140ea6903dd78.tar.gz
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.c')
-rw-r--r--gdb/target.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 24d29850348..5657f89b945 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3073,6 +3073,28 @@ target_core_of_thread (ptid_t ptid)
return -1;
}
+int
+target_verify_memory (const gdb_byte *data, CORE_ADDR memaddr, ULONGEST size)
+{
+ struct target_ops *t;
+
+ for (t = current_target.beneath; t != NULL; t = t->beneath)
+ {
+ if (t->to_verify_memory != NULL)
+ {
+ int retval = t->to_verify_memory (t, data, memaddr, size);
+ if (targetdebug)
+ fprintf_unfiltered (gdb_stdlog, "target_verify_memory (%s, %s) = %d\n",
+ paddress (target_gdbarch, memaddr),
+ pulongest (size),
+ retval);
+ return retval;
+ }
+ }
+
+ tcomplain ();
+}
+
static void
debug_to_prepare_to_store (struct regcache *regcache)
{