* mi/mi-main.c (mi_cmd_data_read_memory): Dispatch
authorPedro Alves <palves@redhat.com>
Tue, 16 Jun 2009 18:23:36 +0000 (18:23 +0000)
committerPedro Alves <palves@redhat.com>
Tue, 16 Jun 2009 18:23:36 +0000 (18:23 +0000)
TARGET_OJECT_MEMORY reads to the topmost target, not the the
flattened current_target.

gdb/ChangeLog
gdb/mi/mi-main.c

index ff4238e465cb7cbec4ab57bfe9182f1665904090..812b83e46415ab7aeaac2085e969d4c2cd1ba16b 100644 (file)
@@ -1,3 +1,9 @@
+2009-06-16  Pedro Alves  <pedro@codesourcery.com>
+
+       * mi/mi-main.c (mi_cmd_data_read_memory): Dispatch
+       TARGET_OJECT_MEMORY reads to the topmost target, not to the
+       flattened current_target.
+
 2009-06-16  Tristan Gingold  <gingold@adacore.com>
 
        * avr-tdep.c (struct gdbarch_tdep): Replace the unused field with
index 73aec0ffb4490772f69fcfab7ba4ff29c3441157..13d69285f57d2d3b76b00af7000b9caa23196d72 100644 (file)
@@ -915,8 +915,11 @@ mi_cmd_data_read_memory (char *command, char **argv, int argc)
   mbuf = xcalloc (total_bytes, 1);
   make_cleanup (xfree, mbuf);
 
-  nr_bytes = target_read_until_error (&current_target, TARGET_OBJECT_MEMORY, 
-                                     NULL, mbuf, addr, total_bytes);
+  /* Dispatch memory reads to the topmost target, not the flattened
+     current_target.  */
+  nr_bytes = target_read_until_error (current_target.beneath,
+                                     TARGET_OBJECT_MEMORY, NULL, mbuf,
+                                     addr, total_bytes);
   if (nr_bytes <= 0)
     error ("Unable to read memory.");