unwind-cxx.h (__is_gxx_forced_unwind_class, [...]): Define for ARM EABI unwinder.

* libsupc++/unwind-cxx.h (__is_gxx_forced_unwind_class,
	__GXX_INIT_FORCED_UNWIND_CLASS): Define for ARM EABI unwinder.
	* libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Call
	__GXX_INIT_FORCED_UNWIND_CLASS for forced unwind with ARM EABI
	unwinder.
	* libsupc++/eh_arm.cc (__cxa_type_match): Use
	__is_gxx_forced_unwind_class to check for forced unwind.

From-SVN: r137683
This commit is contained in:
Joseph Myers 2008-07-10 01:57:16 +01:00 committed by Joseph Myers
parent a222c04e02
commit e32717fc89
4 changed files with 47 additions and 5 deletions

View File

@ -1,3 +1,13 @@
2008-07-09 Joseph Myers <joseph@codesourcery.com>
* libsupc++/unwind-cxx.h (__is_gxx_forced_unwind_class,
__GXX_INIT_FORCED_UNWIND_CLASS): Define for ARM EABI unwinder.
* libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Call
__GXX_INIT_FORCED_UNWIND_CLASS for forced unwind with ARM EABI
unwinder.
* libsupc++/eh_arm.cc (__cxa_type_match): Use
__is_gxx_forced_unwind_class to check for forced unwind.
2008-07-09 Andreas Beckmann <gcc@abeckmann.de>
PR libstdc++/36552

View File

@ -46,12 +46,14 @@ __cxa_type_match(_Unwind_Exception* ue_header,
bool is_reference __attribute__((__unused__)),
void** thrown_ptr_p)
{
bool foreign_exception = !__is_gxx_exception_class(ue_header->exception_class);
bool forced_unwind = __is_gxx_forced_unwind_class(ue_header->exception_class);
bool foreign_exception = !forced_unwind && !__is_gxx_exception_class(ue_header->exception_class);
__cxa_exception* xh = __get_exception_header_from_ue(ue_header);
const std::type_info* throw_type;
// XXX What to do with forced unwind?
if (foreign_exception)
if (forced_unwind)
throw_type = &typeid(abi::__forced_unwind);
else if (foreign_exception)
throw_type = &typeid(abi::__foreign_exception);
else
throw_type = xh->exceptionType;

View File

@ -544,8 +544,12 @@ PERSONALITY_FUNCTION (int version,
#ifdef __ARM_EABI_UNWINDER__
throw_type = ue_header;
if ((actions & _UA_FORCE_UNWIND)
|| foreign_exception)
if (actions & _UA_FORCE_UNWIND)
{
__GXX_INIT_FORCED_UNWIND_CLASS(ue_header->exception_class);
thrown_ptr = 0;
}
else if (foreign_exception)
thrown_ptr = 0;
#else
// During forced unwinding, match a magic exception type.

View File

@ -201,6 +201,32 @@ __GXX_INIT_EXCEPTION_CLASS(_Unwind_Exception_Class c)
c[7] = '\0';
}
static inline bool
__is_gxx_forced_unwind_class(_Unwind_Exception_Class c)
{
return c[0] == 'G'
&& c[1] == 'N'
&& c[2] == 'U'
&& c[3] == 'C'
&& c[4] == 'F'
&& c[5] == 'O'
&& c[6] == 'R'
&& c[7] == '\0';
}
static inline void
__GXX_INIT_FORCED_UNWIND_CLASS(_Unwind_Exception_Class c)
{
c[0] = 'G';
c[1] = 'N';
c[2] = 'U';
c[3] = 'C';
c[4] = 'F';
c[5] = 'O';
c[6] = 'R';
c[7] = '\0';
}
static inline void*
__gxx_caught_object(_Unwind_Exception* eo)
{