public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch Darwin/Ada] work around PR target/50678
@ 2011-10-18 12:24 Iain Sandoe
  2011-10-18 12:32 ` Arnaud Charlet
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Iain Sandoe @ 2011-10-18 12:24 UTC (permalink / raw)
  To: GCC Patches; +Cc: Eric Botcazou

The audit trail in the PR contains the detective work (mostly by Eric)  
that concludes we have a long-standing bug in the Darwin x86-64  
sigtramp unwind data.
This has been filed as radar #10302855, but we need a work-around  
until that is resolved (possibly forever on older systems).

OK for trunk?
(what opinion about 4.6?)

ada:

	PR target/50678
	* init.c (Darwin/__gnat_error_handler): Transpose rbx and rdx in the
	handler.

Index: gcc/ada/init.c
===================================================================
--- gcc/ada/init.c	(revision 180097)
+++ gcc/ada/init.c	(working copy)
@@ -2287,6 +2287,16 @@ __gnat_error_handler (int sig, siginfo_t *si,  
void
  {
    struct Exception_Data *exception;
    const char *msg;
+#if defined (__x86_64__)
+  /* Work around radar #10302855/pr50678, where the unwinders  
(libunwind or
+     libgcc_s depending on the system revision) and the DWARF unwind  
data for
+     the sigtramp have different ideas about register numbering  
(causing rbx
+     and rdx to be transposed).  */
+  ucontext_t *uc = (ucontext_t *)ucontext ;
+  unsigned long t = uc->uc_mcontext->__ss.__rbx;
+  uc->uc_mcontext->__ss.__rbx = uc->uc_mcontext->__ss.__rdx;
+  uc->uc_mcontext->__ss.__rdx =t;
+#endif

    switch (sig)
      {

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-11-17 20:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-18 12:24 [Patch Darwin/Ada] work around PR target/50678 Iain Sandoe
2011-10-18 12:32 ` Arnaud Charlet
2011-10-18 12:47   ` Iain Sandoe
2011-10-18 13:07     ` Arnaud Charlet
2011-10-28 12:57       ` Iain Sandoe
2011-10-18 19:29 ` Mike Stump
2011-11-12 14:17 ` Eric Botcazou
2011-11-17 19:47   ` Iain Sandoe
2011-11-17 20:38     ` Eric Botcazou

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