This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Fix MI -data-read-memory regression
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Marc Khouzam <marc dot khouzam at ericsson dot com>
- Date: Tue, 16 Jun 2009 19:19:56 +0100
- Subject: Fix MI -data-read-memory regression
I'm checking this in as obvious to fix the crash Marc
pointed out:
http://sourceware.org/ml/gdb/2009-06/msg00176.html
I missed this conversion in the recent patch that yanked out
target_ops->to_sections.
--
Pedro Alves
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 the the
flattened current_target.
---
gdb/mi/mi-main.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Index: src/gdb/mi/mi-main.c
===================================================================
--- src.orig/gdb/mi/mi-main.c 2009-06-16 19:10:46.000000000 +0100
+++ src/gdb/mi/mi-main.c 2009-06-16 19:11:56.000000000 +0100
@@ -915,7 +915,9 @@ mi_cmd_data_read_memory (char *command,
mbuf = xcalloc (total_bytes, 1);
make_cleanup (xfree, mbuf);
- nr_bytes = target_read_until_error (¤t_target, TARGET_OBJECT_MEMORY,
+ /* 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.");