Implement _Unwind_GetIP and _Unwind_GetIPInfo as functions as that is what

we expect on FreeBSD. The implementation is based on the existing macros.
This commit is contained in:
Andrew Turner 2013-08-31 14:56:09 +00:00
parent 69f351c4c2
commit 2f393c15a6
2 changed files with 21 additions and 0 deletions

View File

@ -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

View File

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