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] Don't assume next in deprecated_update_frame_pc_hack


Hello,

This gets around a problem caused by the Arm. That target is allocating a local `struct frame_info' and then that local object's PC.

Given that the function is deprecated hack so I'm not too phased about how nast it is, so I've made it a bigger hack.

Thanks to corinna to pointing this out.

committed,
Andrew
2003-03-11  Andrew Cagney  <cagney at redhat dot com>

	* frame.c (deprecated_update_frame_pc_hack): Don't assume a next
	frame.  Problem found by Corinna Vinschen.

Index: frame.c
===================================================================
RCS file: /cvs/src/src/gdb/frame.c,v
retrieving revision 1.75
diff -u -r1.75 frame.c
--- frame.c	10 Mar 2003 15:28:40 -0000	1.75
+++ frame.c	11 Mar 2003 17:32:24 -0000
@@ -1583,12 +1583,18 @@
 {
   /* See comment in "frame.h".  */
   frame->pc = pc;
-  /* While we're at it, update this frame's cached PC value, found in
-     the next frame.  Oh, for the day when "struct frame_info" is
-     opaque and this hack on hack can go.  */
-  gdb_assert (frame->next != NULL);
-  frame->next->pc_unwind_cache = pc;
-  frame->next->pc_unwind_cache_p = 1;
+  /* NOTE: cagney/2003-03-11: Some architectures (e.g., Arm) are
+     maintaining a locally allocated frame object.  Since such frame's
+     are not in the frame chain, it isn't possible to assume that the
+     frame has a next.  Sigh.  */
+  if (frame->next != NULL)
+    {
+      /* While we're at it, update this frame's cached PC value, found
+	 in the next frame.  Oh for the day when "struct frame_info"
+	 is opaque and this hack on hack can just go away.  */
+      frame->next->pc_unwind_cache = pc;
+      frame->next->pc_unwind_cache_p = 1;
+    }
 }
 
 void

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