diff options
author | Rüdiger Timm <rt@openoffice.org> | 2008-12-09 08:43:20 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2008-12-09 08:43:20 +0000 |
commit | ec7fe07d774a1a45695ade0cb883cd8ba42fdf70 (patch) | |
tree | e62730a35f4e932f95928ac9601e035270671dd1 /bridges | |
parent | dda636683a3b4cc639533e4c7b3ca01fc9deff2c (diff) |
CWS-TOOLING: integrate CWS os2port04
2008-11-27 13:22:38 +0100 ydario r264480 : #i96439#: fix build for unix platforms.
2008-11-26 18:32:42 +0100 ydario r264433 : #i96439#: os2 systemshell code (dummy code).
2008-11-26 16:33:48 +0100 ydario r264421 : #i96439#: vcl fix for pdf export of truetype fonts.
2008-11-26 15:04:44 +0100 ydario r264399 : #i96439#: build macros fix scripts, gcc specific flags.
2008-11-26 15:00:15 +0100 ydario r264398 : #i96439#: vcl source code updates.
2008-11-26 13:21:37 +0100 ydario r264378 : #i96439#: os2 build system fixes.
2008-11-26 13:20:27 +0100 ydario r264377 : #i96439#: configuration and build macros updates.
2008-11-26 13:16:35 +0100 ydario r264375 : #i96439#: new launcher code, build system updates.
2008-11-26 13:12:49 +0100 ydario r264373 : #i96439#: use OSL endian macro.
2008-11-26 12:54:50 +0100 ydario r264371 : #i96439#: os2 build system fixes.
2008-11-26 12:30:46 +0100 ydario r264367 : #i96439#: os2 build system fixes.
2008-11-26 12:09:33 +0100 ydario r264365 : #i96439#: _Export is a reserved keyword under gcc for os2.
2008-11-26 12:08:12 +0100 ydario r264364 : #i96439#: new libpath handling.
2008-11-26 11:57:51 +0100 ydario r264363 : #i96439#: use C call, generates proper stabs; fix rtti names.
Diffstat (limited to 'bridges')
-rw-r--r-- | bridges/source/cpp_uno/gcc3_os2_intel/except.cxx | 4 | ||||
-rw-r--r-- | bridges/source/cpp_uno/gcc3_os2_intel/uno2cpp.cxx | 43 |
2 files changed, 37 insertions, 10 deletions
diff --git a/bridges/source/cpp_uno/gcc3_os2_intel/except.cxx b/bridges/source/cpp_uno/gcc3_os2_intel/except.cxx index bd413b0397c0..157d94ad73b2 100644 --- a/bridges/source/cpp_uno/gcc3_os2_intel/except.cxx +++ b/bridges/source/cpp_uno/gcc3_os2_intel/except.cxx @@ -195,8 +195,8 @@ exit(1); { // we must generate it ! // symbol and rtti-name is nearly identical, - // the symbol is prefixed with _ZTI - char const * rttiName = symName.getStr() +4; + // the symbol is prefixed with __ZTI + char const * rttiName = symName.getStr() +5; #if OSL_DEBUG_LEVEL > 1 fprintf( stderr,"generated rtti for %s\n", rttiName ); #endif diff --git a/bridges/source/cpp_uno/gcc3_os2_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_os2_intel/uno2cpp.cxx index b4f7fc3dc180..f3f31236aea9 100644 --- a/bridges/source/cpp_uno/gcc3_os2_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_os2_intel/uno2cpp.cxx @@ -49,6 +49,22 @@ namespace { //================================================================================================== +// The call instruction within the asm section of callVirtualMethod may throw +// exceptions. So that the compiler handles this correctly, it is important +// that (a) callVirtualMethod might call dummy_can_throw_anything (although this +// never happens at runtime), which in turn can throw exceptions, and (b) +// callVirtualMethod is not inlined at its call site (so that any exceptions are +// caught which are thrown from the instruction calling callVirtualMethod): +static void callVirtualMethod( + void * pAdjustedThisPtr, + sal_Int32 nVtableIndex, + void * pRegisterReturn, + typelib_TypeClass eReturnType, + sal_Int32 * pStackLongs, + sal_Int32 nStackLongs ); +// __attribute__((noinline)); + +//================================================================================================== static void callVirtualMethod( void * pAdjustedThisPtr, sal_Int32 nVtableIndex, @@ -67,6 +83,17 @@ static void callVirtualMethod( // never called if (! pAdjustedThisPtr) CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything("xxx"); // address something + /* figure out the address of the function we need to invoke */ + unsigned long * mfunc; // actual function to be invoked + int off; // offset used to find function + void (*ptr)(); + off = nVtableIndex; + off = off * 4; // 4 bytes per slot + mfunc = *((unsigned long **)pAdjustedThisPtr); // get the address of the vtable + mfunc = (unsigned long *)((char *)mfunc + off); // get the address from the vtable entry at offset + mfunc = *((unsigned long **)mfunc); // the function is stored at the address + ptr = (void (*)())mfunc; + volatile long edx = 0, eax = 0; // for register returns void * stackptr; asm volatile ( @@ -82,14 +109,14 @@ static void callVirtualMethod( "sub $4, %%edx\n\t" "dec %%eax\n\t" "jne Lcopy\n\t" - // do the actual call - "mov %2, %%edx\n\t" - "mov 0(%%edx), %%edx\n\t" - "mov %3, %%eax\n\t" - "shl $2, %%eax\n\t" - "add %%eax, %%edx\n\t" - "mov 0(%%edx), %%edx\n\t" - "call *%%edx\n\t" + : + : "m"(nStackLongs), "m"(pStackLongs), "m"(pAdjustedThisPtr), + "m"(nVtableIndex), "m"(eax), "m"(edx), "m"(stackptr) + : "eax", "edx" ); + + (*ptr)(); + + asm volatile ( // save return registers "mov %%eax, %4\n\t" "mov %%edx, %5\n\t" |