diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ff4238e465c..812b83e4641 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2009-06-16 Pedro Alves + + * 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 * avr-tdep.c (struct gdbarch_tdep): Replace the unused field with diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 73aec0ffb44..13d69285f57 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -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 (¤t_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.");