diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx index 37d75659fdb6..ae3418437761 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx @@ -39,6 +39,10 @@ #include #include +#if defined OSL_DEBUG_LEVEL +#undef OSL_DEBUG_LEVEL +#endif +#define OSL_DEBUG_LEVEL 3 using namespace ::com::sun::star::uno; @@ -47,6 +51,8 @@ namespace ppc64 #if defined(_CALL_ELF) && _CALL_ELF == 2 bool is_complex_struct(const typelib_TypeDescription * type) { + bool bRet = false; + printf("is_complex_struct()\n"); const typelib_CompoundTypeDescription * p = reinterpret_cast< const typelib_CompoundTypeDescription * >(type); for (sal_Int32 i = 0; i < p->nMembers; ++i) @@ -59,22 +65,28 @@ namespace ppc64 bool b = is_complex_struct(t); TYPELIB_DANGER_RELEASE(t); if (b) { - return true; + bRet = true; + break; } } - else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass)) - return true; + else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass)) { + bRet = true; + break; + } } if (p->pBaseTypeDescription != 0) return is_complex_struct(&p->pBaseTypeDescription->aBase); - return false; + printf("is_complex_struct() - bRet=%d\n", bRet); + return bRet; } #endif bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ) { + bool bRet = true; + printf("return_in_hidden_param()\n"); if (bridges::cpp_uno::shared::isSimpleType(pTypeRef)) - return false; + bRet = false; #if defined(_CALL_ELF) && _CALL_ELF == 2 else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION) { @@ -82,18 +94,20 @@ namespace ppc64 TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef ); //A Composite Type not larger than 16 bytes is returned in up to two GPRs - bool bRet = pTypeDescr->nSize > 16 || is_complex_struct(pTypeDescr); + bRet = pTypeDescr->nSize > 16 || is_complex_struct(pTypeDescr); TYPELIB_DANGER_RELEASE( pTypeDescr ); - return bRet; +// return bRet; } #endif - return true; + printf("return_in_hidden_param() - bRet=%d\n", bRet); + return bRet; } } void MapReturn(long r3, long r4, double dret, typelib_TypeDescriptionReference* pReturnType, void *pRegisterReturn) { + printf("MapReturn()\n"); switch (pReturnType->eTypeClass) { case typelib_TypeClass_HYPER: @@ -123,6 +137,7 @@ void MapReturn(long r3, long r4, double dret, typelib_TypeDescriptionReference* #if defined(_CALL_ELF) && _CALL_ELF == 2 case typelib_TypeClass_STRUCT: case typelib_TypeClass_EXCEPTION: + printf("STRUCT\n"); if (!ppc64::return_in_hidden_param(pReturnType)) { sal_uInt64 *pRegisters = reinterpret_cast(pRegisterReturn); @@ -215,6 +230,9 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, register sal_uInt64 r3 asm("r3"); register sal_uInt64 r4 asm("r4"); + register sal_uInt64 f1 asm("fr1"); + register sal_uInt64 f2 asm("fr2"); + (*pFunc)(pGPR[0], pGPR[1], pGPR[2], pGPR[3], pGPR[4], pGPR[5], pGPR[6], pGPR[7]); // get return value @@ -224,6 +242,8 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, "fmr %0, 1\n\t" : "=f" (dret), "=r" (r3), "=r" (r4) : ); + printf("f1=%p (%lf) f2=%p (%lf)\n", f1, f1, f2, f2); + MapReturn(r3, r4, dret, reinterpret_cast(pReturnTypeDescr), pRegisterReturn); } diff --git a/bridges/source/cpp_uno/shared/bridge.cxx b/bridges/source/cpp_uno/shared/bridge.cxx index 3753341ccde2..fd09b95babc4 100644 --- a/bridges/source/cpp_uno/shared/bridge.cxx +++ b/bridges/source/cpp_uno/shared/bridge.cxx @@ -31,6 +31,8 @@ #include #include +#include + namespace bridges::cpp_uno::shared { void freeMapping(uno_Mapping * pMapping) @@ -52,6 +54,7 @@ void cpp2unoMapping( uno_Mapping * pMapping, void ** ppUnoI, void * pCppI, typelib_InterfaceTypeDescription * pTypeDescr) { + printf("cpp2unoMapping()\n"); assert(ppUnoI && pTypeDescr); if (*ppUnoI) { @@ -98,6 +101,7 @@ void uno2cppMapping( uno_Mapping * pMapping, void ** ppCppI, void * pUnoI, typelib_InterfaceTypeDescription * pTypeDescr) { + printf("uno2cppMapping()\n"); assert(ppCppI && pTypeDescr); if (*ppCppI) { diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx index 5e09a8899690..26f030dece02 100644 --- a/bridges/source/jni_uno/jni_bridge.cxx +++ b/bridges/source/jni_uno/jni_bridge.cxx @@ -22,6 +22,7 @@ #include #include +#include #include "jni_bridge.h" #include "jniunoenvironmentdata.hxx" @@ -60,6 +61,7 @@ void Mapping_map_to_uno( void * pIn, typelib_InterfaceTypeDescription * td ) SAL_THROW_EXTERN_C() { + printf("Mapping_map_to_uno\n"); uno_Interface ** ppUnoI = reinterpret_cast(ppOut); jobject javaI = static_cast(pIn); @@ -119,6 +121,7 @@ void Mapping_map_to_java( void * pIn, typelib_InterfaceTypeDescription * td ) SAL_THROW_EXTERN_C() { + printf("Mapping_map_to_java\n"); jobject * ppJavaI = reinterpret_cast(ppOut); uno_Interface * pUnoI = static_cast(pIn); @@ -514,6 +517,7 @@ SAL_DLLPUBLIC_EXPORT void uno_ext_getMapping( uno_Mapping ** ppMapping, uno_Environment * pFrom, uno_Environment * pTo ) SAL_THROW_EXTERN_C() { + printf("uno_ext_getMapping\n"); assert(ppMapping != nullptr); assert(pFrom != nullptr); assert(pTo != nullptr); @@ -545,6 +549,7 @@ SAL_DLLPUBLIC_EXPORT void uno_ext_getMapping( { if ( from_env_typename == UNO_LB_JAVA && to_env_typename == UNO_LB_UNO ) { + printf("java->uno\n"); Bridge * bridge = new Bridge( pFrom, pTo->pExtEnv, true ); // ref count = 1 mapping = &bridge->m_java2uno; @@ -555,6 +560,7 @@ SAL_DLLPUBLIC_EXPORT void uno_ext_getMapping( } else if ( from_env_typename == UNO_LB_UNO && to_env_typename == UNO_LB_JAVA ) { + printf("uno->java\n"); Bridge * bridge = new Bridge( pTo, pFrom->pExtEnv, false ); // ref count = 1 mapping = &bridge->m_uno2java; diff --git a/bridges/source/jni_uno/jni_data.cxx b/bridges/source/jni_uno/jni_data.cxx index 06e8467f7e7c..a07603140ec0 100644 --- a/bridges/source/jni_uno/jni_data.cxx +++ b/bridges/source/jni_uno/jni_data.cxx @@ -1,3 +1,5 @@ +#pragma GCC optimize("O1") + /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. @@ -21,6 +23,7 @@ #include #include +#include #include "jni_bridge.h" @@ -50,6 +53,8 @@ void createDefaultUnoValue( typelib_TypeDescriptionReference * type, JNI_type_info const * info /* maybe 0 */, bool assign) { + printf("createDefaultUnoValue()\n"); + switch (type->eTypeClass) { case typelib_TypeClass_BOOLEAN: *static_cast< sal_Bool * >(uno_data) = false; @@ -84,6 +89,7 @@ void createDefaultUnoValue( break; case typelib_TypeClass_FLOAT: + printf("FLOAT\n"); *static_cast< float * >(uno_data) = 0; break; @@ -148,6 +154,7 @@ void createDefaultUnoValue( case typelib_TypeClass_STRUCT: { + printf("STRUCT\n"); if (info == nullptr) { info = jni.get_info()->get_type_info(jni, type); } @@ -216,6 +223,8 @@ void Bridge::map_to_uno( bool assign, bool out_param, bool special_wrapped_integral_types ) const { + printf("Bridge::map_to_uno() - typecall=%d out_param=%c\n", type->eTypeClass, out_param ? 'Y' : 'N'); + assert( !out_param || (jni->GetArrayLength( static_cast(java_data.l) ) == 1) ); @@ -334,6 +343,7 @@ void Bridge::map_to_uno( } break; case typelib_TypeClass_FLOAT: + printf("map_to_uno: FLOAT\n"); if (out_param) { jni->GetFloatArrayRegion( @@ -352,6 +362,7 @@ void Bridge::map_to_uno( } break; case typelib_TypeClass_DOUBLE: + printf("map_to_uno: DOUBLE\n"); if (out_param) { jni->GetDoubleArrayRegion( @@ -568,6 +579,7 @@ void Bridge::map_to_uno( } break; case typelib_TypeClass_FLOAT: + printf("map_to_uno: FLOAT 2\n"); if (sizeof (float) <= sizeof (void *)) { pAny->pData = &pAny->pReserved; @@ -628,6 +640,7 @@ void Bridge::map_to_uno( case typelib_TypeClass_STRUCT: case typelib_TypeClass_EXCEPTION: { + printf("STRUCT (or EXCP)\n"); std::unique_ptr< rtl_mem > mem( rtl_mem::allocate( value_td.get()->nSize ) ); map_to_uno( @@ -680,6 +693,7 @@ void Bridge::map_to_uno( break; } case typelib_TypeClass_STRUCT: + printf("STRUCT top-level\n"); case typelib_TypeClass_EXCEPTION: { JLocalAutoRef jo_out_holder( jni ); @@ -731,6 +745,7 @@ void Bridge::map_to_uno( bool parameterizedType = polymorphic && reinterpret_cast< typelib_StructTypeDescription * >( comp_td)->pParameterizedTypes[nPos]; + printf("member %i, type=%d\n", nPos, member_type->eTypeClass); switch (member_type->eTypeClass) { case typelib_TypeClass_CHAR: @@ -844,6 +859,7 @@ void Bridge::map_to_uno( } break; case typelib_TypeClass_FLOAT: + printf("map_to_uno: FLOAT 3 "); if (parameterizedType) { JLocalAutoRef jo( jni, jni->GetObjectField( java_data.l, field_id ) ); @@ -860,6 +876,7 @@ void Bridge::map_to_uno( *static_cast(p) = jni->GetFloatField( java_data.l, field_id ); } + printf("f=%f p=%p\n", *(jfloat *)(p), p); break; case typelib_TypeClass_DOUBLE: if (parameterizedType) { @@ -1018,6 +1035,7 @@ void Bridge::map_to_uno( jni.ensure_no_exception(); break; case typelib_TypeClass_FLOAT: + printf("map_to_uno: FLOAT 4\n"); seq = seq_allocate( nElements, sizeof (float) ); jni->GetFloatArrayRegion( static_cast(java_data.l), 0, nElements, @@ -1036,6 +1054,7 @@ void Bridge::map_to_uno( case typelib_TypeClass_ANY: case typelib_TypeClass_ENUM: case typelib_TypeClass_STRUCT: + printf("STRUCT\n"); case typelib_TypeClass_EXCEPTION: case typelib_TypeClass_SEQUENCE: case typelib_TypeClass_INTERFACE: @@ -1160,6 +1179,7 @@ void Bridge::map_to_java( bool in_param, bool out_param, bool special_wrapped_integral_types ) const { + printf("Bridge::map_to_java() - type=%d\n", type->eTypeClass); // 4th param of Set*ArrayRegion changed from pointer to non-const to pointer // to const between and l == nullptr) @@ -1714,6 +1735,7 @@ void Bridge::map_to_java( } case typelib_TypeClass_STRUCT: { + printf("STRUCT\n"); // Do not lose information about type arguments of instantiated // polymorphic struct types: OUString const & name = OUString::unacquired( @@ -1821,6 +1843,7 @@ void Bridge::map_to_java( break; } case typelib_TypeClass_STRUCT: + printf("STRUCT\n"); case typelib_TypeClass_EXCEPTION: { if (info == nullptr) @@ -1995,6 +2018,7 @@ void Bridge::map_to_java( } break; case typelib_TypeClass_FLOAT: + printf("map_to_uno: FLOAT 6 - %f = 0x%x\n", *(jfloat *)(p), *(sal_uInt32 *)(p)); if (parameterizedType) { jvalue arg; arg.f = *static_cast(p); @@ -2171,6 +2195,7 @@ void Bridge::map_to_java( } break; case typelib_TypeClass_FLOAT: + printf("map_to_uno: FLOAT 7\n"); jo_ar.reset( jni->NewFloatArray( nElements ) ); jni.ensure_no_exception(); if (0 < nElements) @@ -2294,6 +2319,7 @@ void Bridge::map_to_java( break; } case typelib_TypeClass_STRUCT: + printf("STRUCT\n"); case typelib_TypeClass_EXCEPTION: { JNI_type_info const * element_info = diff --git a/bridges/source/jni_uno/jni_java2uno.cxx b/bridges/source/jni_uno/jni_java2uno.cxx index 53f761e82657..a2a2fb193d55 100644 --- a/bridges/source/jni_uno/jni_java2uno.cxx +++ b/bridges/source/jni_uno/jni_java2uno.cxx @@ -1,3 +1,5 @@ +#pragma GCC optimize("O1") + /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. @@ -22,6 +24,7 @@ #include #include +#include #include @@ -36,6 +39,8 @@ jobject Bridge::map_to_java( JNI_context const & jni, uno_Interface * pUnoI, JNI_interface_type_info const * info ) const { + printf("jni_uno::Bridge::map_to_java\n"); + // get oid rtl_uString * pOid = nullptr; (*m_uno_env->getObjectIdentifier)( m_uno_env, &pOid, pUnoI ); @@ -163,6 +168,8 @@ jobject Bridge::call_uno( sal_Int32 nParams, typelib_MethodParameter const * pParams, jobjectArray jo_args /* may be 0 */ ) const { + printf("jni_uno::Bridge::call_uno\n"); + // return mem sal_Int32 return_size; switch (return_type->eTypeClass) { diff --git a/bridges/source/jni_uno/jni_uno2java.cxx b/bridges/source/jni_uno/jni_uno2java.cxx index 98666dfc1929..1c1b4b6a1599 100644 --- a/bridges/source/jni_uno/jni_uno2java.cxx +++ b/bridges/source/jni_uno/jni_uno2java.cxx @@ -1,3 +1,5 @@ +#pragma GCC optimize("O1") + /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. @@ -24,6 +26,7 @@ #include #include #include +#include #include @@ -68,6 +71,8 @@ void Bridge::handle_java_exc( JNI_context const & jni, JLocalAutoRef const & jo_exc, uno_Any * uno_exc ) const { + printf("Bridge::handle_java_exc\n"); + assert( jo_exc.is() ); if (! jo_exc.is()) { @@ -130,6 +135,8 @@ void Bridge::call_java( typelib_MethodParameter * params, sal_Int32 nParams, void * uno_ret, void * uno_args [], uno_Any ** uno_exc ) const { + printf("Bridge::call_java() - return_type=%d nParams=%d\n", return_type->eTypeClass, nParams); + assert( function_pos_offset == 0 || function_pos_offset == 1 ); JNI_guarded_context jni( @@ -270,10 +277,12 @@ void Bridge::call_java( jni->CallLongMethodA( javaI, method_id, java_args ); break; case typelib_TypeClass_FLOAT: + printf("Bridge::call_java FLOAT\n"); *static_cast(uno_ret) = jni->CallFloatMethodA( javaI, method_id, java_args ); break; case typelib_TypeClass_DOUBLE: + printf("Bridge::call_java DOUBLE\n"); *static_cast(uno_ret) = jni->CallDoubleMethodA( javaI, method_id, java_args ); break; @@ -564,6 +573,8 @@ void UNO_proxy_dispatch( void * uno_ret, void * uno_args [], uno_Any ** uno_exc ) SAL_THROW_EXTERN_C() { + printf("UNO_proxy_dispatch\n"); + UNO_proxy const * that = static_cast< UNO_proxy const * >( pUnoI ); Bridge const * bridge = that->m_bridge; diff --git a/dbaccess/Module_dbaccess.mk b/dbaccess/Module_dbaccess.mk index 436f591c7a07..4bedcc59159d 100644 --- a/dbaccess/Module_dbaccess.mk +++ b/dbaccess/Module_dbaccess.mk @@ -62,7 +62,7 @@ ifeq ($(ENABLE_JAVA),TRUE) ifneq ($(OS),MACOSX) $(eval $(call gb_Module_add_check_targets,dbaccess,\ CppunitTest_dbaccess_hsqldb_test \ - CppunitTest_dbaccess_RowSetClones \ + \ )) endif endif diff --git a/dictionaries b/dictionaries index 272686e247e8..e32c98b7aa5d 160000 --- a/dictionaries +++ b/dictionaries @@ -1 +1 @@ -Subproject commit 272686e247e81719b86c71d7d1672bc775d91031 +Subproject commit e32c98b7aa5dc8b451f3ca1ba2f447f4534e77fc diff --git a/helpcontent2 b/helpcontent2 index 49cc168cf185..3f46135d08a1 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 49cc168cf18562283b308f039cc8fc37b8866fed +Subproject commit 3f46135d08a1174b15985b2e46e82a23733b8087 diff --git a/testtools/com/sun/star/comp/bridge/TestComponent.java b/testtools/com/sun/star/comp/bridge/TestComponent.java index 271b139565fb..d8ed4cda8d11 100644 --- a/testtools/com/sun/star/comp/bridge/TestComponent.java +++ b/testtools/com/sun/star/comp/bridge/TestComponent.java @@ -496,6 +496,7 @@ public class TestComponent { } public TwoFloats echoTwoFloats( TwoFloats i_Struct) throws com.sun.star.uno.RuntimeException { + System.err.println("java echoTwoFloats()"); return i_Struct; } diff --git a/testtools/source/bridgetest/bridgetest.cxx b/testtools/source/bridgetest/bridgetest.cxx index 9e3eb90c1de9..275581bae24a 100644 --- a/testtools/source/bridgetest/bridgetest.cxx +++ b/testtools/source/bridgetest/bridgetest.cxx @@ -1,3 +1,5 @@ +#pragma GCC optimize("O0") + /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. @@ -57,6 +59,7 @@ #include #include #include +#include using namespace osl; using namespace cppu; @@ -66,6 +69,18 @@ using namespace com::sun::star::registry; using namespace com::sun::star::bridge; using namespace test::testtools::bridgetest; +static void hexdump(void *data, size_t size) +{ + size_t i = 0; + + while(i < size) + { + printf("%02x ", ((unsigned char *)data)[i++]); + if (i % 16 == 0) + printf("\n"); + } + printf("\n"); +} constexpr OUStringLiteral SERVICENAME = u"com.sun.star.test.bridge.BridgeTest"; constexpr OUStringLiteral IMPLNAME = u"com.sun.star.comp.bridge.BridgeTest"; @@ -366,9 +381,11 @@ static bool performTest( const Reference & xLBT, bool noCurrentContext ) { + printf("performTest()\n"); check(xLBT.is(), "### no test interface!"); bool bRet = true; if (xLBT.is()) { +#if 0 // this data is never ever granted access to by calls other than // equals(), assign()! TestData aData; // test against this data @@ -469,16 +486,36 @@ static bool performTest( equals(aData, aSV2ret) && equals(aData, aRet2), "getValues2 test"); } +#endif { - TwoFloats aIn(1.1f, 2.2f); - TwoFloats aOut = xLBT->echoTwoFloats(aIn); + register double f1 asm("fr1"); + register sal_Int64 r3 asm("r3"); + sal_Int64 r3_val; + + TwoFloats aIn(1.25f, 2.5f); + printf("TwoFloats() - aIn=%p\n", &aIn); + hexdump(&aIn, sizeof(TwoFloats)); + TwoFloats aOut; + memset(&aOut, 0, sizeof(TwoFloats)); + printf("calling echoTwoFloats()\n"); + aOut = xLBT->echoTwoFloats(aIn); + r3_val = r3; + printf("TwoFloats() - aOut=%p\n", &aOut); + hexdump(&aOut - 2, sizeof(TwoFloats) + 24); + printf("f1=%lf aOut.a=%f r3=%p\n", f1, aOut.a, r3_val); bRet = check( memcmp(&aIn, &aOut, sizeof(TwoFloats)) == 0, "two floats struct test" ) && bRet; } +#if 0 { FourFloats aIn(3.3f, 4.4f, 5.5f, 6.6f); + printf("FourFloats()\n"); + hexdump(&aIn, sizeof(FourFloats)); FourFloats aOut = xLBT->echoFourFloats(aIn); + hexdump(&aOut, sizeof(FourFloats)); bRet = check( memcmp(&aIn, &aOut, sizeof(FourFloats)) == 0, "four floats struct test" ) && bRet; } +#endif +#if 0 { MixedFloatAndInteger aIn(7.7f, 8); MixedFloatAndInteger aOut = xLBT->echoMixedFloatAndInteger(aIn); @@ -986,6 +1023,7 @@ static bool performTest( bRet = false; } } +#endif } return bRet; } diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx index 32742110f341..acb5e3a21d35 100644 --- a/testtools/source/bridgetest/cppobj.cxx +++ b/testtools/source/bridgetest/cppobj.cxx @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -64,6 +65,19 @@ using namespace test::testtools::bridgetest; constexpr OUStringLiteral SERVICENAME = u"com.sun.star.test.bridge.CppTestObject"; constexpr OUStringLiteral IMPLNAME = u"com.sun.star.comp.bridge.CppTestObject"; +static void hexdump(void *data, size_t size) +{ + size_t i = 0; + + while(i < size) + { + printf("%02x ", ((unsigned char *)data)[i++]); + if (i % 16 == 0) + printf("\n"); + } + printf("\n"); +} + namespace bridge_object { @@ -241,7 +255,7 @@ public: virtual BigStruct SAL_CALL echoBigStruct(const BigStruct& rStruct) override { return rStruct; } virtual TwoFloats SAL_CALL echoTwoFloats(const TwoFloats& rStruct) override - { return rStruct; } + { printf("cpp echoTwoFloats()\n"); hexdump((void *)&rStruct, sizeof(TwoFloats)); return rStruct; } virtual FourFloats SAL_CALL echoFourFloats(const FourFloats& rStruct) override { return rStruct; } virtual MixedFloatAndInteger SAL_CALL echoMixedFloatAndInteger(const MixedFloatAndInteger& rStruct) override