Author: hdu
Date: Thu Mar 27 15:42:55 2014
New Revision: 1582360

URL: http://svn.apache.org/r1582360
Log:
#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.

Merged from trunk revision 1582359.

Modified:
    openoffice/branches/AOO410/   (props changed)
    openoffice/branches/AOO410/main/   (props changed)
    
openoffice/branches/AOO410/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/except.cxx
    
openoffice/branches/AOO410/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/share.hxx

Propchange: openoffice/branches/AOO410/
------------------------------------------------------------------------------
  Merged /openoffice/trunk:r1582359

Propchange: openoffice/branches/AOO410/main/
------------------------------------------------------------------------------
  Merged /openoffice/trunk/main:r1582359

Modified: 
openoffice/branches/AOO410/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/except.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/except.cxx?rev=1582360&r1=1582359&r2=1582360&view=diff
==============================================================================
--- 
openoffice/branches/AOO410/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/except.cxx
 (original)
+++ 
openoffice/branches/AOO410/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/except.cxx
 Thu Mar 27 15:42:55 2014
@@ -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_Compo
                 // 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_Compo
                     // this class has no base class
                     rtti = new __class_type_info( strdup( rttiName ) );
                 }
-                
-                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?!" );
+#else
+                rtti = NULL;
+#endif
+
+                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_Compo
 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 );

Modified: 
openoffice/branches/AOO410/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/share.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/share.hxx?rev=1582360&r1=1582359&r2=1582360&view=diff
==============================================================================
--- 
openoffice/branches/AOO410/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/share.hxx
 (original)
+++ 
openoffice/branches/AOO410/main/bridges/source/cpp_uno/s5abi_macosx_x86-64/share.hxx
 Thu Mar 27 15:42:55 2014
@@ -85,6 +85,8 @@ extern "C" __cxa_eh_globals *__cxa_get_g
 
 // -----
 
+#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 );


Reply via email to