This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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 (&current_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.");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]