Kaydet (Commit) 184348f1 authored tarafından Herbert Dürr's avatar Herbert Dürr

#i124421# disable generated type_info for the OSX64 uno bridge

When the dynamic loading of the type_info symbols failed the UNO bridge
synthesized type_info objects itself. The synthesized ones trigger the
crash observed so we disable their generation and handle the result
gracefully.
üst 88b1d351
......@@ -39,6 +39,7 @@
#include <rtl/ustrbuf.hxx>
#include <osl/diagnose.h>
#include <osl/mutex.hxx>
#include <tools/debug.hxx>
#include <com/sun/star/uno/genfunc.hxx>
#include "com/sun/star/uno/RuntimeException.hpp"
......@@ -174,9 +175,15 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
// symbol and rtti-name is nearly identical,
// the symbol is prefixed with _ZTI
char const * rttiName = symName.getStr() +4;
#if OSL_DEBUG_LEVEL > 1
#if OSL_DEBUG_LEVEL >= 1
fprintf( stderr,"generated rtti for %s\n", rttiName );
const OString aCUnoName = OUStringToOString( unoName, RTL_TEXTENCODING_UTF8);
DBG_WARNING1( "TypeInfo for \"%s\" not found and cannot be generated.\n", aCUnoName.getStr());
#endif
#if 0 // TODO: enable it again when the generated class_type_infos always work.
// Forcing the toolchain to create authentic typeinfos is much better though
// than the sick concept of reverse-engineering the platform's toolchain
// and generating the missing type_infos.
if (pTypeDescr->pBaseTypeDescription)
{
// ensure availability of base
......@@ -190,10 +197,12 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
// this class has no base class
rtti = new __class_type_info( strdup( rttiName ) );
}
#else
rtti = NULL;
#endif
pair< t_rtti_map::iterator, bool > insertion(
m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) );
OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" );
bool bOK = m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti )).second;
OSL_ENSURE( bOK, "### inserting new generated rtti failed?!" );
}
else // taking already generated rtti
{
......@@ -213,6 +222,8 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
static void deleteException( void * pExc )
{
__cxa_exception const * header = ((__cxa_exception const *)pExc - 1);
if( !header->exceptionType) // TODO: remove this when getRTTI() always returns non-NULL
return; // NOTE: leak for now
typelib_TypeDescription * pTD = 0;
OUString unoName( toUNOname( header->exceptionType->name() ) );
::typelib_typedescription_getByName( &pTD, unoName.pData );
......
......@@ -85,6 +85,8 @@ extern "C" __cxa_eh_globals *__cxa_get_globals () throw();
// -----
#if 0 // #i124421# disabled because its use in except.cxx is disabled
// on OSX 64bit the class_type_info classes are specified
// in http://refspecs.linuxbase.org/cxxabi-1.86.html#rtti but
// these details are not generally available in a public header
......@@ -106,6 +108,8 @@ public:
{}
};
#endif
//==================================================================================================
void raiseException(
uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment