20#include <rtl/ustrbuf.hxx>
23#include <com/sun/star/uno/genfunc.hxx>
24#include <com/sun/star/uno/RuntimeException.hpp>
25#include <typelib/typedescription.hxx>
42#if OSL_DEBUG_LEVEL > 1
48 OUStringBuffer buf( 64 );
56 while (
'0' <= *
p &&
'9' >= *
p)
61 buf.appendAscii(
p,
n );
67#if OSL_DEBUG_LEVEL > 1
68 OUString ret( buf.makeStringAndClear() );
70 fprintf( stderr,
"> toUNOname(): %s => %s\n",
start, c_ret.getStr() );
73 return buf.makeStringAndClear();
81#if defined _LIBCPPABI_VERSION
119 reinterpret_cast<char const *
>(
header) - 8);
124 reinterpret_cast<char const *
>(
header) + 8);
136 ::typelib_typedescription_getByName( &pTD, unoName.pData );
137 assert(pTD &&
"### unknown exception type! leaving out destruction => leaking!!!");
140 ::uno_destructData( pExc, pTD, cpp_release );
141 ::typelib_typedescription_release( pTD );
148#if OSL_DEBUG_LEVEL > 1
151 OUString::unacquired( &pUnoExc->pType->pTypeName ),
152 RTL_TEXTENCODING_ASCII_US ) );
153 fprintf( stderr,
"> uno exception occurred: %s\n", cstr.getStr() );
161 TYPELIB_DANGER_GET( &pTypeDescr, pUnoExc->pType );
166 "cannot get typedescription for type " +
167 OUString::unacquired( &pUnoExc->pType->pTypeName ) );
171 ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp );
174 ::uno_any_destruct( pUnoExc,
nullptr );
177 TYPELIB_DANGER_RELEASE( pTypeDescr );
178 assert(rtti &&
"### no rtti for throwing exception!");
182 "no rtti for type " +
183 OUString::unacquired( &pUnoExc->pType->pTypeName ) );
202#if defined _LIBCPPABI_VERSION
225 if (*
reinterpret_cast<void **
>(header) ==
nullptr) {
233 OUString unoName(
toUNOname( exceptionType->name() ) );
234#if OSL_DEBUG_LEVEL > 1
236 fprintf( stderr,
"> c++ exception occurred: %s\n", cstr_unoName.getStr() );
239 if (pExcTypeDescr ==
nullptr)
constexpr sal_Int8 header[]
void SAL_CALL uno_type_any_constructAndConvert(uno_Any *pDest, void *pSource, typelib_TypeDescriptionReference *pType, uno_Mapping *mapping) SAL_THROW_EXTERN_C()
void SAL_CALL uno_any_constructAndConvert(uno_Any *pDest, void *pSource, typelib_TypeDescription *pTypeDescr, uno_Mapping *mapping) SAL_THROW_EXTERN_C()
#define _GLIBCXX_CDTOR_CALLABI
#define SAL_WARN(area, stream)
struct _uno_Mapping uno_Mapping
struct _typelib_TypeDescription typelib_TypeDescription
static void deleteException(void *pExc)
void fillUnoException(uno_Any *pUnoExc, uno_Mapping *pCpp2Uno)
static OUString toUNOname(char const *p)
void raiseException(uno_Any *pUnoExc, uno_Mapping *pUno2Cpp)
void __cxa_throw(void *thrown_exception, std::type_info *tinfo, void(*dest)(void *)) __attribute__((noreturn))
__cxa_eh_globals * __cxa_get_globals()
void * __cxa_allocate_exception(size_t thrown_size)
std::type_info * __cxa_current_exception_type()
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
std::type_info * getRtti(typelib_TypeDescription const &type)
__cxa_exception * caughtExceptions
void SAL_CALL typelib_typedescription_release(typelib_TypeDescription *pTD) SAL_THROW_EXTERN_C()
void SAL_CALL typelib_typedescription_getByName(typelib_TypeDescription **ppRet, rtl_uString *pName) SAL_THROW_EXTERN_C()