This is the mail archive of the gdb-patches@sources.redhat.com 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]

[commit] d10v set's frame ID . code_addr to func


Hello,

This tweak's the d10v's this_id() method so that it the frame ID's code address points at the frame's function's address.

Of course it has no effect since frame_id_eq() doesn't yet do it in comparisons.

committed,
Andrew
2003-04-10  Andrew Cagney  <cagney at redhat dot com>

	* d10v-tdep.c (d10v_frame_this_id): Set the code addr to the
	frame's function's address.  Simplify.
	(d10v_frame_unwind_cache): Check that the frame's function is
	non-zero.

Index: d10v-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/d10v-tdep.c,v
retrieving revision 1.105
diff -u -r1.105 d10v-tdep.c
--- d10v-tdep.c	8 Apr 2003 21:56:09 -0000	1.105
+++ d10v-tdep.c	11 Apr 2003 03:11:26 -0000
@@ -710,7 +710,7 @@
 
   info->uses_frame = 0;
   for (pc = frame_func_unwind (next_frame);
-       pc < frame_pc_unwind (next_frame);
+       pc > 0 && pc < frame_pc_unwind (next_frame);
        pc += 4)
     {
       op = (unsigned long) read_memory_integer (pc, 4);
@@ -1440,14 +1440,15 @@
   struct d10v_unwind_cache *info
     = d10v_frame_unwind_cache (next_frame, this_prologue_cache);
   CORE_ADDR base;
-  CORE_ADDR pc;
+  CORE_ADDR func;
+  struct frame_id id;
 
-  /* The PC is easy.  */
-  pc = frame_pc_unwind (next_frame);
+  /* The FUNC is easy.  */
+  func = frame_func_unwind (next_frame);
 
   /* This is meant to halt the backtrace at "_start".  Make sure we
      don't halt it at a generic dummy frame. */
-  if (pc == IMEM_START || pc <= IMEM_START || inside_entry_file (pc))
+  if (func <= IMEM_START || inside_entry_file (func))
     return;
 
   /* Hopefully the prologue analysis either correctly determined the
@@ -1457,17 +1458,18 @@
   if (base == STACK_START || base == 0)
     return;
 
+  id = frame_id_build (base, func);
+
   /* Check that we're not going round in circles with the same frame
      ID (but avoid applying the test to sentinel frames which do go
      round in circles).  Can't use frame_id_eq() as that doesn't yet
      compare the frame's PC value.  */
   if (frame_relative_level (next_frame) >= 0
       && get_frame_type (next_frame) != DUMMY_FRAME
-      && get_frame_pc (next_frame) == pc
-      && get_frame_base (next_frame) == base)
+      && frame_id_eq (get_frame_id (next_frame), id))
     return;
 
-  (*this_id) = frame_id_build (base, pc);
+  (*this_id) = id;
 }
 
 static void

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