svn commit: r255096 - head/contrib/gcc/config/arm
Andrew Turner
andrew at FreeBSD.org
Sat Aug 31 14:56:10 UTC 2013
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)
More information about the svn-src-all
mailing list