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]

[frameaddr-20030403-branch] Merge with mainline


FYI,

I've merged the frameaddr-20030403-branch with the mainline (it contains a fixed frame_id_eq). Attatched is the remaining set of differences.

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

	* frame.c (get_frame_id): Return this frame's "id".
	(frame_id_eq): Fail when code addresses do not match.
	(legacy_saved_regs_this_id): Set this frame ID's code_addr to
	zero.
	(create_new_frame): Set the frame's ID.
	(legacy_get_prev_frame): Set prev's frame ID code_addr to the
	function start.
	* d10v-tdep.c (d10v_frame_unwind_cache): Check for a zero func.
	(d10v_frame_this_id): Get the frame's function, use frame_id_eq.

Index: breakpoint.c
===================================================================
RCS file: /cvs/src/src/gdb/breakpoint.c,v
retrieving revision 1.118
retrieving revision 1.117.2.1
diff -u -r1.118 -r1.117.2.1
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	10 Apr 2003 21:22:02 -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);
@@ -1442,8 +1442,8 @@
   CORE_ADDR base;
   CORE_ADDR pc;
 
-  /* The PC is easy.  */
-  pc = frame_pc_unwind (next_frame);
+  /* The PC/FUNC is easy.  */
+  pc = 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. */
@@ -1463,8 +1463,8 @@
      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),
+		      frame_id_build (base, pc)))
     return;
 
   (*this_id) = frame_id_build (base, pc);
Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.105
diff -u -r1.105 frame.c
--- frame.c	10 Apr 2003 15:32:27 -0000	1.105
+++ frame.c	10 Apr 2003 21:22:04 -0000
@@ -145,7 +145,7 @@
 	  fprintf_unfiltered (gdb_stdlog, " }\n");
 	}
     }
-  return frame_id_build (fi->this_id.value.stack_addr, get_frame_pc (fi));
+  return fi->this_id.value;
 }
 
 const struct frame_id null_frame_id; /* All zeros.  */
@@ -191,10 +191,8 @@
     /* The .stack and .code are identical, the ID's are identical.  */
     eq = 1;
   else
-    /* FIXME: cagney/2003-04-06: This should be zero.  Can't yet do
-       this because most frame ID's are not being initialized
-       correctly.  */
-    eq = 1;
+    /* No luck.  */
+    eq = 0;
   if (frame_debug)
     {
       fprintf_unfiltered (gdb_stdlog, "{ frame_id_eq (l=");
@@ -931,7 +929,7 @@
 	 unwinding a sentinel frame, the PC of which is pointing at a
 	 stack dummy.  Fake up the dummy frame's ID using the same
 	 sequence as is found a traditional unwinder.  */
-      (*id) = frame_id_build (read_fp (), read_pc ());
+      (*id) = frame_id_build (read_fp (), 0);
       return;
     }
 
@@ -984,7 +982,7 @@
   /* FIXME: cagney/2002-06-08: This should probably return the frame's
      function and not the PC (a.k.a. resume address).  */
   pc = frame_pc_unwind (next_frame);
-  (*id) = frame_id_build (base, pc);
+  (*id) = frame_id_build (base, 0 /*pc*/);
 }
 	
 const struct frame_unwind legacy_saved_regs_unwinder = {
@@ -1137,6 +1135,11 @@
 
   fi = frame_obstack_zalloc (sizeof (struct frame_info));
 
+  /* FIXME: cagney/2003-04-02: Should this instead try to map that pc
+     onto a function.  */
+  fi->this_id.p = 1;
+  fi->this_id.value = frame_id_build (addr, pc);
+
   fi->next = create_sentinel_frame (current_regcache);
 
   /* Select/initialize both the unwind function and the frame's type
@@ -1370,6 +1373,11 @@
 	{
 	  DEPRECATED_INIT_EXTRA_FRAME_INFO (0, prev);
 	}
+
+      if (prev->type == NORMAL_FRAME)
+	prev->this_id.value.code_addr
+	  = get_pc_function_start (prev->this_id.value.code_addr);
+
       if (frame_debug)
 	{
 	  fprintf_unfiltered (gdb_stdlog, "-> ");
@@ -1578,6 +1586,9 @@
   if (prev->unwind->type != UNKNOWN_FRAME)
     {
       prev->type = prev->unwind->type;
+      if (prev->type == NORMAL_FRAME)
+	prev->this_id.value.code_addr
+	  = get_pc_function_start (prev->this_id.value.code_addr);
       if (frame_debug)
 	{
 	  fprintf_unfiltered (gdb_stdlog, "-> ");
@@ -1619,6 +1630,10 @@
          moved to the start of this function, all this nastness will
          go away.  */
     }
+
+  if (prev->type == NORMAL_FRAME)
+    prev->this_id.value.code_addr
+      = get_pc_function_start (prev->this_id.value.code_addr);
 
   if (frame_debug)
     {

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