public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Set _UA_HANDLER_FRAME based on CFA, not IP
@ 2007-05-18 22:49 Geoffrey Keating
  0 siblings, 0 replies; only message in thread
From: Geoffrey Keating @ 2007-05-18 22:49 UTC (permalink / raw)
  To: gcc-patches


The C++ ABI says

_UA_HANDLER_FRAME
  During phase 2, indicates to the personality routine that the current
  frame is the one which was flagged as the handler frame during phase
  1.

It turns out that every personality routine that GCC provides will
return _URC_HANDLER_FOUND based only on the IP, and so will never
return _URC_CONTINUE_UNWIND the first time it sees a stack frame for a
particular IP and then _URC_HANDLER_FOUND when looking at a later
stack frame.  (Apple has a developer who is generating their own
object code and providing their own personality routine, and theirs
apparently doesn't have this property.)

Since the ABI says that it is frames, not object code, which are
flagged, this means the context should be based on the CFA not on the
IP.

uw_identify_context appears to be used only in unwind.inc so this
should not cause any incompatibilities.

Bootstrapped & tested on powerpc-darwin8.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-unwind-cfacontext.patch===============
2007-05-16  Geoffrey Keating  <geoffk@apple.com>

	* unwind-dw2.c (uw_identify_context): Use the CFA, not the IP.

Index: unwind-dw2.c
===================================================================
--- unwind-dw2.c	(revision 124749)
+++ unwind-dw2.c	(working copy)
@@ -1526,7 +1526,7 @@
 static inline _Unwind_Ptr
 uw_identify_context (struct _Unwind_Context *context)
 {
-  return _Unwind_GetIP (context);
+  return _Unwind_GetCFA (context);
 }
 
 
============================================================

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

only message in thread, other threads:[~2007-05-18 22:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-18 22:49 Set _UA_HANDLER_FRAME based on CFA, not IP Geoffrey Keating

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).