Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Aug 2013 14:56:09 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r255096 - head/contrib/gcc/config/arm
Message-ID:  <201308311456.r7VEu9wL029522@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Sat Aug 31 14:56:09 2013
New Revision: 255096
URL: http://svnweb.freebsd.org/changeset/base/255096

Log:
  Implement _Unwind_GetIP and _Unwind_GetIPInfo as functions as that is what
  we expect on FreeBSD. The implementation is based on the existing macros.

Modified:
  head/contrib/gcc/config/arm/unwind-arm.c
  head/contrib/gcc/config/arm/unwind-arm.h

Modified: head/contrib/gcc/config/arm/unwind-arm.c
==============================================================================
--- head/contrib/gcc/config/arm/unwind-arm.c	Sat Aug 31 14:53:19 2013	(r255095)
+++ head/contrib/gcc/config/arm/unwind-arm.c	Sat Aug 31 14:56:09 2013	(r255096)
@@ -1074,3 +1074,19 @@ _Unwind_GetTextRelBase (_Unwind_Context 
 {
   abort ();
 }
+
+#ifdef __FreeBSD__
+/* FreeBSD expects these to be functions */
+_Unwind_Ptr
+_Unwind_GetIP (struct _Unwind_Context *context)
+{
+  return _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1;
+}
+
+_Unwind_Ptr
+_Unwind_GetIPInfo (struct _Unwind_Context *context, int *ip_before_insn)
+{
+  *ip_before_insn = 0;
+  return _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1;
+}
+#endif

Modified: head/contrib/gcc/config/arm/unwind-arm.h
==============================================================================
--- head/contrib/gcc/config/arm/unwind-arm.h	Sat Aug 31 14:53:19 2013	(r255095)
+++ head/contrib/gcc/config/arm/unwind-arm.h	Sat Aug 31 14:56:09 2013	(r255096)
@@ -253,12 +253,17 @@ extern "C" {
       return val;
     }
 
+#ifndef __FreeBSD__
   /* Return the address of the instruction, not the actual IP value.  */
 #define _Unwind_GetIP(context) \
   (_Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
 
 #define _Unwind_GetIPInfo(context, ip_before_insn) \
   (*ip_before_insn = 0, _Unwind_GetGR (context, 15) & ~(_Unwind_Word)1)
+#else
+  _Unwind_Ptr _Unwind_GetIP (struct _Unwind_Context *);
+  _Unwind_Ptr _Unwind_GetIPInfo (struct _Unwind_Context *, int *);
+#endif
 
   static inline void
   _Unwind_SetGR (_Unwind_Context *context, int regno, _Unwind_Word val)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308311456.r7VEu9wL029522>