Lines 39-44
Link Here
|
39 |
#include <rtl/ustrbuf.hxx> |
39 |
#include <rtl/ustrbuf.hxx> |
40 |
#include <osl/diagnose.h> |
40 |
#include <osl/diagnose.h> |
41 |
#include <osl/mutex.hxx> |
41 |
#include <osl/mutex.hxx> |
|
|
42 |
#include <tools/debug.hxx> |
42 |
|
43 |
|
43 |
#include <com/sun/star/uno/genfunc.hxx> |
44 |
#include <com/sun/star/uno/genfunc.hxx> |
44 |
#include "com/sun/star/uno/RuntimeException.hpp" |
45 |
#include "com/sun/star/uno/RuntimeException.hpp" |
Lines 174-182
type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
Link Here
|
174 |
// symbol and rtti-name is nearly identical, |
175 |
// symbol and rtti-name is nearly identical, |
175 |
// the symbol is prefixed with _ZTI |
176 |
// the symbol is prefixed with _ZTI |
176 |
char const * rttiName = symName.getStr() +4; |
177 |
char const * rttiName = symName.getStr() +4; |
177 |
#if OSL_DEBUG_LEVEL > 1 |
178 |
#if OSL_DEBUG_LEVEL >= 1 |
178 |
fprintf( stderr,"generated rtti for %s\n", rttiName ); |
179 |
fprintf( stderr,"generated rtti for %s\n", rttiName ); |
|
|
180 |
const OString aCUnoName = OUStringToOString( unoName, RTL_TEXTENCODING_UTF8); |
181 |
DBG_WARNING1( "TypeInfo for \"%s\" not found and cannot be generated.\n", aCUnoName.getStr()); |
179 |
#endif |
182 |
#endif |
|
|
183 |
#if 0 // TODO: enable it again when the generated class_type_infos always work. |
184 |
// Forcing the toolchain to create authentic typeinfos is much better though |
185 |
// than the sick concept of reverse-engineering the platform's toolchain |
186 |
// and generating the missing type_infos. |
180 |
if (pTypeDescr->pBaseTypeDescription) |
187 |
if (pTypeDescr->pBaseTypeDescription) |
181 |
{ |
188 |
{ |
182 |
// ensure availability of base |
189 |
// ensure availability of base |
Lines 190-199
type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
Link Here
|
190 |
// this class has no base class |
197 |
// this class has no base class |
191 |
rtti = new __class_type_info( strdup( rttiName ) ); |
198 |
rtti = new __class_type_info( strdup( rttiName ) ); |
192 |
} |
199 |
} |
193 |
|
200 |
#else |
194 |
pair< t_rtti_map::iterator, bool > insertion( |
201 |
rtti = NULL; |
195 |
m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); |
202 |
#endif |
196 |
OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" ); |
203 |
|
|
|
204 |
bool bOK = m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti )).second; |
205 |
OSL_ENSURE( bOK, "### inserting new generated rtti failed?!" ); |
197 |
} |
206 |
} |
198 |
else // taking already generated rtti |
207 |
else // taking already generated rtti |
199 |
{ |
208 |
{ |
Lines 213-218
type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR
Link Here
|
213 |
static void deleteException( void * pExc ) |
222 |
static void deleteException( void * pExc ) |
214 |
{ |
223 |
{ |
215 |
__cxa_exception const * header = ((__cxa_exception const *)pExc - 1); |
224 |
__cxa_exception const * header = ((__cxa_exception const *)pExc - 1); |
|
|
225 |
if( !header->exceptionType) // TODO: remove this when getRTTI() always returns non-NULL |
226 |
return; // NOTE: leak for now |
216 |
typelib_TypeDescription * pTD = 0; |
227 |
typelib_TypeDescription * pTD = 0; |
217 |
OUString unoName( toUNOname( header->exceptionType->name() ) ); |
228 |
OUString unoName( toUNOname( header->exceptionType->name() ) ); |
218 |
::typelib_typedescription_getByName( &pTD, unoName.pData ); |
229 |
::typelib_typedescription_getByName( &pTD, unoName.pData ); |