public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-rmoseley-F9-patch-merge: Add final linking fix, have a couple compile erros to go after I comment them back in.
@ 2008-11-19 22:37 rmoseley
  0 siblings, 0 replies; only message in thread
From: rmoseley @ 2008-11-19 22:37 UTC (permalink / raw)
  To: archer-commits

The branch, archer-rmoseley-F9-patch-merge has been updated
       via  eecf8a1bffed2ed860ea995647afdc71982d508f (commit)
      from  507be30a312572fcbfb751d201aa112c2fabcf60 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit eecf8a1bffed2ed860ea995647afdc71982d508f
Author: Rick Moseley <rmoseley@localhost.localdomain>
Date:   Wed Nov 19 16:36:23 2008 -0600

    Add final linking fix, have a couple compile erros to go after I comment them back in.

-----------------------------------------------------------------------

Summary of changes:
 gdb/frame.c |   60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 0 deletions(-)

First 500 lines of diff:
diff --git a/gdb/frame.c b/gdb/frame.c
index 0215966..f48f1aa 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -573,6 +573,24 @@ frame_pc_unwind (struct frame_info *this_frame)
 }
 
 CORE_ADDR
+frame_func_unwind (struct frame_info *fi, enum frame_type this_type)
+{
+  if (!fi->prev_func.p)
+    {
+      /* Make certain that this, and not the adjacent, function is
+         found.  */
+      CORE_ADDR addr_in_block = frame_unwind_address_in_block (fi, this_type);
+      fi->prev_func.p = 1;
+      fi->prev_func.addr = get_pc_function_start (addr_in_block);
+      if (frame_debug)
+	fprintf_unfiltered (gdb_stdlog,
+			    "{ frame_func_unwind (fi=%d) -> 0x%s }\n",
+			    fi->level, paddr_nz (fi->prev_func.addr));
+    }
+  return fi->prev_func.addr;
+}
+
+CORE_ADDR
 get_frame_func (struct frame_info *this_frame)
 {
   struct frame_info *next_frame = this_frame->next;
@@ -1686,6 +1704,48 @@ get_frame_pc (struct frame_info *frame)
   return frame_pc_unwind (frame->next);
 }
 
+/* Return an address that falls within NEXT_FRAME's caller's code
+   block, assuming that the caller is a THIS_TYPE frame.  */
+
+CORE_ADDR
+frame_unwind_address_in_block (struct frame_info *next_frame,
+			       enum frame_type this_type)
+{
+  /* A draft address.  */
+  CORE_ADDR pc = frame_pc_unwind (next_frame);
+
+  /* If NEXT_FRAME was called by a signal frame or dummy frame, then
+     we should not adjust the unwound PC.  These frames may not call
+     their next frame in the normal way; the operating system or GDB
+     may have pushed their resume address manually onto the stack, so
+     it may be the very first instruction.  Even if the resume address
+     was not manually pushed, they expect to be returned to.  */
+  if (this_type != NORMAL_FRAME && this_type != INLINE_FRAME)
+    return pc;
+
+  /* If NEXT_FRAME was inlined into the current frame, we are really
+     interested in an even younger (newer) frame - the point where
+     execution left THIS function.  */
+  while (get_frame_type (next_frame) == INLINE_FRAME)
+    next_frame = next_frame->next;
+
+  /* If THIS frame is not inner most (i.e., NEXT isn't the sentinel),
+     and NEXT is `normal' (i.e., not a sigtramp, dummy, ....) THIS
+     frame's PC ends up pointing at the instruction fallowing the
+     "call".  Adjust that PC value so that it falls on the call
+     instruction (which, hopefully, falls within THIS frame's code
+     block).  So far it's proved to be a very good approximation.  See
+     get_frame_type() for why ->type can't be used.
+
+     This is correct even if NEXT_FRAME describes an inlined function.
+     Inlined functions always live between two normal frames, and are
+     themselves normal.  */
+  if (next_frame->level >= 0
+      && get_frame_type (next_frame) == NORMAL_FRAME)
+    --pc;
+  return pc;
+}
+
 /* Return an address that falls within THIS_FRAME's code block.  */
 
 CORE_ADDR


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-11-19 22:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-19 22:37 [SCM] archer-rmoseley-F9-patch-merge: Add final linking fix, have a couple compile erros to go after I comment them back in rmoseley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).