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]

Disable the stack cache when inspecting trace frames (tfind mode)


This was actually caught by gdb.trace/ :-)

I've applied this to head and branch.

-- 
Pedro Alves

2010-03-12  Pedro Alves  <pedro@codesourcery.com>

	gdb/
	* target.c (memory_xfer_partial): Don't use the stack cache if
	inspecting trace frames.
	* tracepoint.c (finish_tfind_command): Invalidate the target
	dcache.

---
 gdb/target.c     |    5 +++++
 gdb/tracepoint.c |    1 +
 2 files changed, 6 insertions(+)

Index: src/gdb/target.c
===================================================================
--- src.orig/gdb/target.c	2010-03-12 03:47:05.000000000 +0000
+++ src/gdb/target.c	2010-03-12 03:48:27.000000000 +0000
@@ -43,6 +43,7 @@
 #include "solib.h"
 #include "exec.h"
 #include "inline-frame.h"
+#include "tracepoint.h"
 
 static void target_info (char *, int);
 
@@ -1292,6 +1293,10 @@ memory_xfer_partial (struct target_ops *
     inf = NULL;
 
   if (inf != NULL
+      /* The dcache reads whole cache lines; that doesn't play well
+	 with reading from a trace buffer, because reading outside of
+	 the collected memory range fails.  */
+      && get_traceframe_number () == -1
       && (region->attrib.cache
 	  || (stack_cache_enabled_p && object == TARGET_OBJECT_STACK_MEMORY)))
     {
Index: src/gdb/tracepoint.c
===================================================================
--- src.orig/gdb/tracepoint.c	2010-03-12 03:47:05.000000000 +0000
+++ src/gdb/tracepoint.c	2010-03-12 03:48:27.000000000 +0000
@@ -1757,6 +1757,7 @@ finish_tfind_command (enum trace_find_ty
 
   reinit_frame_cache ();
   registers_changed ();
+  target_dcache_invalidate ();
   set_traceframe_num (target_frameno);
   set_tracepoint_num (tp ? tp->number : target_tracept);
   if (target_frameno == -1)


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