From 6c258edb19ac9bc6e26715b6c722c13d69880bc8 Mon Sep 17 00:00:00 2001 From: andrew Date: Sat, 31 Aug 2013 14:56:09 +0000 Subject: Implement _Unwind_GetIP and _Unwind_GetIPInfo as functions as that is what we expect on FreeBSD. The implementation is based on the existing macros. --- contrib/gcc/config/arm/unwind-arm.c | 16 ++++++++++++++++ contrib/gcc/config/arm/unwind-arm.h | 5 +++++ 2 files changed, 21 insertions(+) (limited to 'contrib/gcc') diff --git a/contrib/gcc/config/arm/unwind-arm.c b/contrib/gcc/config/arm/unwind-arm.c index 945dfd8..47354b4 100644 --- a/contrib/gcc/config/arm/unwind-arm.c +++ b/contrib/gcc/config/arm/unwind-arm.c @@ -1074,3 +1074,19 @@ _Unwind_GetTextRelBase (_Unwind_Context *context __attribute__ ((unused))) { 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 diff --git a/contrib/gcc/config/arm/unwind-arm.h b/contrib/gcc/config/arm/unwind-arm.h index c6404eb..8a5c5ce 100644 --- a/contrib/gcc/config/arm/unwind-arm.h +++ b/contrib/gcc/config/arm/unwind-arm.h @@ -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) -- cgit v1.1