summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bridges/source/cpp_uno/gcc3_os2_intel/except.cxx4
-rw-r--r--bridges/source/cpp_uno/gcc3_os2_intel/uno2cpp.cxx43
-rw-r--r--cppu/prj/d.lst3
-rw-r--r--cppu/source/helper/purpenv/export.mk2
-rw-r--r--cppuhelper/source/gcc3os2.map6
-rw-r--r--sal/osl/os2/module.c41
-rw-r--r--sal/osl/os2/salinit.cxx4
-rw-r--r--stoc/test/makefile.mk4
8 files changed, 57 insertions, 50 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"
diff --git a/cppu/prj/d.lst b/cppu/prj/d.lst
index d84af457ba75..f019d78ad661 100644
--- a/cppu/prj/d.lst
+++ b/cppu/prj/d.lst
@@ -58,8 +58,7 @@ mkdir: %_DEST%\inc%_EXT%\uno
..\%__SRC%\lib\libuno_cppu.*.* %_DEST%\lib%_EXT%\*
..\%__SRC%\lib\ipurpenvhelper* %_DEST%\lib%_EXT%\*
-..\%__SRC%\bin\purpenvh*.dll %_DEST%\bin%_EXT%\*
-..\%__SRC%\bin\upeh*.dll %_DEST%\bin%_EXT%\*
+..\%__SRC%\bin\purpe*.dll %_DEST%\bin%_EXT%\*
..\%__SRC%\lib\libuno_purpenvhelper* %_DEST%\lib%_EXT%\*
..\%__SRC%\bin\unsafe_u*.dll %_DEST%\bin%_EXT%\*
diff --git a/cppu/source/helper/purpenv/export.mk b/cppu/source/helper/purpenv/export.mk
index cd2f57eca50c..7e5e9d04d1d2 100644
--- a/cppu/source/helper/purpenv/export.mk
+++ b/cppu/source/helper/purpenv/export.mk
@@ -5,7 +5,7 @@ NAMEpurpenv_helper := uno_purpenvhelper$(COMID)
purpenv_helper_LIB := -l$(NAMEpurpenv_helper)
.ELIF "$(GUI)"=="OS2"
-NAMEpurpenv_helper := upeh$(UDK_MAJOR)
+NAMEpurpenv_helper := purpeh$(UDK_MAJOR)
purpenv_helper_LIB := i$(NAMEpurpenv_helper)
.ELSE
diff --git a/cppuhelper/source/gcc3os2.map b/cppuhelper/source/gcc3os2.map
index 1a93a046ff6e..6aada0273d59 100644
--- a/cppuhelper/source/gcc3os2.map
+++ b/cppuhelper/source/gcc3os2.map
@@ -368,3 +368,9 @@ UDK_3.4 { # OOo 2.4
global:
_ZN4cppu19bootstrap_expandUriERKN3rtl8OUStringE; # rtl::OUString cppu::bootstrap_expandUri(rtl::OUString const &)
} UDK_3.3;
+
+UDK_3.5 { # OOo 3.0
+ global:
+ _ZN4cppu18OPropertySetHelperC1ERNS_19OBroadcastHelperVarINS_34OMultiTypeInterfaceContainerHelperEN3com3sun4star3uno4TypeEEEPNS_22IEventNotificationHookEb;
+ _ZN4cppu18OPropertySetHelperC2ERNS_19OBroadcastHelperVarINS_34OMultiTypeInterfaceContainerHelperEN3com3sun4star3uno4TypeEEEPNS_22IEventNotificationHookEb;
+} UDK_3.4;
diff --git a/sal/osl/os2/module.c b/sal/osl/os2/module.c
index 36721f80f16b..c8c9731a95ed 100644
--- a/sal/osl/os2/module.c
+++ b/sal/osl/os2/module.c
@@ -70,37 +70,6 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *ustrModuleName, sal_Int32 nRtldMo
OSL_ENSURE(ustrModuleName,"osl_loadModule : string is not valid");
- // to avoid registering dll with full path at every install inside
- // services.rbd, the dll are registere only once with empty path
- // then if drive is not specified, the SAL module path is used
- // to load components.
- if (hModSal == NULL) {
- ULONG ObjNum;
- CHAR Buff[2*_MAX_PATH];
- ULONG Offset;
- char drive[_MAX_DRIVE], dir[_MAX_DIR];
- char fname[_MAX_FNAME], ext[_MAX_EXT];
- // get module handle (and name)
- rc = DosQueryModFromEIP( &hModSal, &ObjNum, sizeof( Buff), Buff,
- &Offset, (ULONG)osl_loadModule);
- if (rc) {
- sal_Char szError[ 120 ];
- sprintf( szError, "DosQueryModFromEIP failed (%s) rc=%d\n", Buff, rc);
- OSL_TRACE(szError);
- return NULL;
- }
- DosQueryModuleName(hModSal, sizeof(Buff), Buff);
- // extract path info
- _splitpath( Buff, szSalDrive, szSalDir, NULL, NULL);
- // update BeginLIBPATH, otherwise a rc=2 can be returned if someone
- // changes the current directory
- CHAR ExtLIBPATH[1024];
- strcpy( ExtLIBPATH, szSalDrive);
- strcat( ExtLIBPATH, szSalDir);
- strcat( ExtLIBPATH, ";%BeginLIBPATH%");
- rc = DosSetExtLIBPATH( (PCSZ)ExtLIBPATH, BEGIN_LIBPATH);
- }
-
/* ensure ustrTmp hold valid string */
if( osl_File_E_None != osl_getSystemPathFromFileURL( ustrModuleName, &ustrTmp ) )
rtl_uString_assign( &ustrTmp, ustrModuleName );
@@ -123,6 +92,12 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *ustrModuleName, sal_Int32 nRtldMo
dot = strchr( fname, '.');
if (dot)
*dot = '\0'; // truncate on dot
+ // if drive is not specified, remove starting \ from dir name
+ // so dll is loaded from LIBPATH
+ if (drive[0] == 0 && dir[0] == '\\' && dir[1] == '\\') {
+ while( dir[0] == '\\')
+ strcpy( dir, dir+1);
+ }
_makepath( buffer, drive, dir, fname, ext);
rc = _DosLoadModule( szErrorMessage, sizeof( szErrorMessage), (PCSZ)buffer, &hModule);
@@ -130,10 +105,6 @@ oslModule SAL_CALL osl_loadModule(rtl_uString *ustrModuleName, sal_Int32 nRtldMo
pModule = (oslModule)hModule;
else
{
- // try again using SAL path
- _makepath( buffer, szSalDrive, szSalDir, fname, ext);
- rc = _DosLoadModule( szErrorMessage, sizeof( szErrorMessage), (PCSZ)buffer, &hModule);
-
if (rc == NO_ERROR )
pModule = (oslModule)hModule;
else
diff --git a/sal/osl/os2/salinit.cxx b/sal/osl/os2/salinit.cxx
index 403259a069af..43130c18e6f4 100644
--- a/sal/osl/os2/salinit.cxx
+++ b/sal/osl/os2/salinit.cxx
@@ -93,6 +93,7 @@ void SAL_CALL sal_detail_initialize(int argc, char ** argv)
{
APIRET rc = -1;
+#if OSL_DEBUG_LEVEL == 0
excRegisterHooks(_oslExceptOpenLogFile, NULL, NULL, FALSE);
g_excptstruct.RegRec2.pfnHandler = (PFN)excHandlerLoud;
@@ -105,6 +106,7 @@ void SAL_CALL sal_detail_initialize(int argc, char ** argv)
else
DosBeep(1000, 1000);
g_excptstruct.ulExcpt = setjmp(g_excptstruct.RegRec2.jmpThread);
+#endif
osl_setCommandArgs(argc, argv);
}
@@ -113,7 +115,9 @@ void SAL_CALL sal_detail_deinitialize()
{
APIRET rc = -1;
+#if OSL_DEBUG_LEVEL == 0
rc = DosUnsetExceptionHandler((PEXCEPTIONREGISTRATIONRECORD)&(g_excptstruct.RegRec2));
+#endif
}
}
diff --git a/stoc/test/makefile.mk b/stoc/test/makefile.mk
index e8c60aac711b..419b4c821143 100644
--- a/stoc/test/makefile.mk
+++ b/stoc/test/makefile.mk
@@ -99,10 +99,10 @@ APP3STDLIBS= \
$(REGLIB) \
$(SALLIB)
-.IF "$(GUI)"=="UNX" || "$(GUI)"=="OS2"
+.IF "$(GUI)"=="UNX"
APP3STDLIBS+= -l$(SHL1TARGET)
.ENDIF
-.IF "$(GUI)"=="WNT"
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="OS2"
APP3STDLIBS+= i$(SHL1TARGET).lib
.ENDIF