[ooo-build-commit] .: patches/mono

Noel Power noelp at kemper.freedesktop.org
Thu Aug 19 09:01:21 PDT 2010


 patches/mono/component-support/examples/complextoolbar/mono-tempfixes.diff |  128 +++++++---
 1 file changed, 100 insertions(+), 28 deletions(-)

New commits:
commit 662845d0398e050cdfad283c1911b1eeaf61eb85
Author: Noel Power <noel.power at novell.com>
Date:   Thu Aug 19 17:01:16 2010 +0100

    more debug code, fix escaping native exceptions from managed code
    
    * patches/mono/component-support/examples/complextoolbar/mono-tempfixes.diff:

diff --git a/patches/mono/component-support/examples/complextoolbar/mono-tempfixes.diff b/patches/mono/component-support/examples/complextoolbar/mono-tempfixes.diff
index 1219a0a..4f85ab6 100644
--- a/patches/mono/component-support/examples/complextoolbar/mono-tempfixes.diff
+++ b/patches/mono/component-support/examples/complextoolbar/mono-tempfixes.diff
@@ -1,7 +1,7 @@
-diff --git a/cli_ure/qa/climaker/makefile.mk b/cli_ure/qa/climaker/makefile.mk
+diff --git cli_ure/qa/climaker/makefile.mk cli_ure/qa/climaker/makefile.mk
 index cde3f40..b24c701 100644
---- a/cli_ure/qa/climaker/makefile.mk
-+++ b/cli_ure/qa/climaker/makefile.mk
+--- cli_ure/qa/climaker/makefile.mk
++++ cli_ure/qa/climaker/makefile.mk
 @@ -38,7 +38,6 @@ PACKAGE = climaker
  CLIMAKER*=$(WRAPCMD) $(BIN)$/climaker
  .INCLUDE: settings.mk
@@ -19,25 +19,26 @@ index cde3f40..b24c701 100644
  .IF "$(debug)" != ""
  CSCFLAGS += -checked+ -define:DEBUG -define:TRACE -debug+
  .ELSE
-diff --git a/cli_ure/source/mono_bridge/.bridge.cs.swp b/cli_ure/source/mono_bridge/.bridge.cs.swp
-index 994437f..0964079 100644
-Binary files a/cli_ure/source/mono_bridge/.bridge.cs.swp and b/cli_ure/source/mono_bridge/.bridge.cs.swp differ
-diff --git a/cli_ure/source/mono_bridge/bridge.cs b/cli_ure/source/mono_bridge/bridge.cs
-index bcab902..fe0b147 100644
---- a/cli_ure/source/mono_bridge/bridge.cs
-+++ b/cli_ure/source/mono_bridge/bridge.cs
+diff --git cli_ure/source/mono_bridge/.bridge.cs.swp cli_ure/source/mono_bridge/.bridge.cs.swp
+deleted file mode 100644
+index 994437f..0000000
+Binary files cli_ure/source/mono_bridge/.bridge.cs.swp and /dev/null differ
+diff --git cli_ure/source/mono_bridge/bridge.cs cli_ure/source/mono_bridge/bridge.cs
+index bcab902..50b0b2e 100644
+--- cli_ure/source/mono_bridge/bridge.cs
++++ cli_ure/source/mono_bridge/bridge.cs
 @@ -344,14 +344,18 @@ public unsafe class Bridge
                  TypeDescription.Complete((TypeDescription **)&compTD);
  
              int members = compTD->nMembers;
-+            Console.WriteLine("** struct has " + members + " members " );
++//            Console.WriteLine("** struct has " + members + " members " );
              Type managedType = null;
              if (managedData != null)
                  managedType = managedData.GetType();
  
              if (compTD->pBaseTypeDescription != null)
 +            {
-+                Console.WriteLine( "** probably bad that we are about to recurse here " );
++//                Console.WriteLine( "** probably bad that we are about to recurse here " );
                  MapToUno(unoData, managedData,
                           (TypeDescription *)((TypeDescription *)compTD->pBaseTypeDescription)->pWeakRef,
                           assign);
@@ -49,26 +50,27 @@ index bcab902..fe0b147 100644
                  if (managedData != null)
                  {
                      string fieldName = UString.UStringToString(compTD->ppMemberNames[i]);
-+                    Console.WriteLine( "FieldName[ " + i + " ] is " + fieldName );
++//                    Console.WriteLine( "FieldName[ " + i + " ] is " + fieldName );
                      FieldInfo fieldInfo = managedType.GetField(fieldName);
                      // special case for Exception.Message property
                      // The com.sun.star.uno.Exception.Message field is mapped to the
-@@ -1676,11 +1681,24 @@ public unsafe class Bridge
+@@ -1676,12 +1681,25 @@ public unsafe class Bridge
  	    unoRetPtr = (void *)unoArgs;
  	    unoArgs = (largest *)((byte *)unoRetPtr + returnSize);
  	}
 -
-+        Console.WriteLine( "CallUno calling method with " + nParams + " params ");
++//        Console.WriteLine( "CallUno calling method with " + nParams + " params ");
          for (int i = 0; i < nParams; ++i)
          {
-+            Console.WriteLine( "CallUno getting type for param " + i );
++//            Console.WriteLine( "CallUno getting type for param " + i );
              // FIXME it's a TypeDescriptionReference
 -            TypeDescription *type = (TypeDescription *)parameters[i].pTypeRef;
+-
 +            TypeDescriptionReference *typeref = (TypeDescriptionReference *)parameters[i].pTypeRef;
 +            //TypeDescription *type = typeref->pType;
 +            TypeDescription *type = null;
 +            TypeDescriptionReference.GetDescription(&type, typeref);
-+
++/*
 +            if ( type == null )
 +                Console.WriteLine( "CallUno after getting type for param " + i + " but it's null :-( ");
 +            else 
@@ -77,25 +79,26 @@ index bcab902..fe0b147 100644
 +                string paramTypeName = UString.UStringToString(type->pTypeName); 
 +                Console.WriteLine( "CallUno after typename for param " + i + " is " + paramTypeName + " type size is " + type->nSize );
 +            }
- 
++*/
              unoArgPtrs[i] = unoArgs + i;
              if ((type->eTypeClass == TypeClass.STRUCT ||
+                  type->eTypeClass == TypeClass.EXCEPTION) &&
 @@ -1695,17 +1713,21 @@ public unsafe class Bridge
                              
              if (parameters[i].bIn != 0)
              {
-+                Console.WriteLine( "CallUno calling maptouno for param " + i + " of " + nParams);
++//                Console.WriteLine( "CallUno calling maptouno for param " + i + " of " + nParams);
                  // FIXME error handling
 -                MapToUno(unoArgPtrs[i], args[i], type, false /* no assign */);
 +                MapToUno(unoArgPtrs[i], args[i], (TypeDescription*)typeref, false /* no assign */);
-+                Console.WriteLine( "after CallUno calling maptouno for param " + i  + " of " + nParams);
++//                Console.WriteLine( "after CallUno calling maptouno for param " + i  + " of " + nParams);
              }
          }
  
          uno.Binary.Any unoExceptionHolder;
          uno.Binary.Any *unoExc = &unoExceptionHolder;
  
-+        Console.WriteLine( "before dispatch");
++//        Console.WriteLine( "before dispatch");
          // call binary uno      
          uno.Binary.Interface.Dispatch(
              unoInterface, memberTD, unoRetPtr, unoArgPtrs, &unoExc);
@@ -103,16 +106,65 @@ index bcab902..fe0b147 100644
  
          if (unoExc == null)
          {
-diff --git a/cli_ure/source/mono_bridge/uno_proxy.cs b/cli_ure/source/mono_bridge/uno_proxy.cs
-index f292bf6..f2a8420 100644
---- a/cli_ure/source/mono_bridge/uno_proxy.cs
-+++ b/cli_ure/source/mono_bridge/uno_proxy.cs
+@@ -1828,6 +1850,7 @@ public unsafe class Bridge
+                 MapToManaged(ref args[i], unoArgs[i], parameters[i].pTypeRef, null, false);
+ 
+         object invocationResult = null;
++
+         try
+         {
+             invocationResult = method.Invoke(managedI, args);
+@@ -1835,6 +1858,12 @@ public unsafe class Bridge
+         catch (TargetInvocationException e)
+         {
+             Exception exc = e.InnerException;
++            if ( !( e.InnerException is unoidl.com.sun.star.uno.Exception ) )
++            {
++                // #FIXME put more info in here trace, stack etc. ( when I
++                // figure out how to do that in mono )
++                exc = new unoidl.com.sun.star.uno.RuntimeException( exc.ToString(), null );
++            }
+             TypeDescription* td = null;
+             // FIXME leak
+             TypeDescriptionReference.GetDescription(&td, MapManagedType(exc.GetType()));
+@@ -1846,7 +1875,7 @@ public unsafe class Bridge
+         }
+         catch (Exception e)
+         {
+-            // FIXME
++//            exc = e;
+         }
+ 
+         // convert out, in/out params
+diff --git cli_ure/source/mono_bridge/mono_proxy.cxx cli_ure/source/mono_bridge/mono_proxy.cxx
+index 0a5f130..6004386 100644
+--- cli_ure/source/mono_bridge/mono_proxy.cxx
++++ cli_ure/source/mono_bridge/mono_proxy.cxx
+@@ -191,11 +191,12 @@ inline void MonoProxy::dispatch( typelib_TypeDescription const * member_td,
+     pMonoParams[3] = uno_exc;
+ 
+ 	MonoObject *obj = mono_gchandle_get_target( m_managedProxy );
+-
++    OSL_TRACE("MonoProxy::dispatch( %s )", rtl::OUStringToOString( rtl::OUString( member_td->pTypeName ), RTL_TEXTENCODING_UTF8 ).getStr() );
+     mono_uno::runtime_invoke( m_managedDispatch,
+ 							  obj, pMonoParams, NULL,
+ 							  mono_object_get_domain( obj ) );
++    OSL_TRACE("after MonoProxy::dispatch( %s )", rtl::OUStringToOString( rtl::OUString( member_td->pTypeName ), RTL_TEXTENCODING_UTF8 ).getStr() );
+ }
+-
++    
+ }
+ 
+diff --git cli_ure/source/mono_bridge/uno_proxy.cs cli_ure/source/mono_bridge/uno_proxy.cs
+index f292bf6..ea9b72e 100644
+--- cli_ure/source/mono_bridge/uno_proxy.cs
++++ cli_ure/source/mono_bridge/uno_proxy.cs
 @@ -176,6 +176,8 @@ public unsafe class UnoInterfaceProxy: RealProxy, IRemotingTypeInfo
          Trace.Assert(info != null);
          
          string methodName = callmsg.MethodName;
-+        Console.WriteLine( "Invoke for " +cli_uno.Cli_environment.getObjectIdentifier( this ) );
-+        Console.WriteLine( "method name type " + methodName );
++//        Console.WriteLine( "Invoke for " +cli_uno.Cli_environment.getObjectIdentifier( this ) );
++//        Console.WriteLine( "method name type " + methodName );
          TypeDescriptionReference **ppAllMembers =
          info.TypeDesc->ppAllMembers;
          int numMembers = info.TypeDesc->nAllMembers;
@@ -120,7 +172,7 @@ index f292bf6..f2a8420 100644
                      String.Compare(memberTypeName, offset,
                                     methodName, 0, methodName.Length) == 0)
                  {
-+                    Console.WriteLine( "member name type " + memberTypeName + " match for INTERFACEMETHOD ");
++//                    Console.WriteLine( "member name type " + memberTypeName + " match for INTERFACEMETHOD ");
                      TypeDescription *methodTD = null;
  		    // FIXME release it
  		    TypeDescriptionReference.GetDescription(&methodTD, memberTD);
@@ -132,3 +184,23 @@ index f292bf6..f2a8420 100644
                      return ConstructReturnMessage(result, callmsg.Args,
  						   (InterfaceMethodTypeDescription *)methodTD,
                                                    callmsg, exception);
+diff --git cli_ure/source/ure/uno/util/WeakComponentBase.cs cli_ure/source/ure/uno/util/WeakComponentBase.cs
+index f9c2aa3..1dc668f 100644
+--- cli_ure/source/ure/uno/util/WeakComponentBase.cs
++++ cli_ure/source/ure/uno/util/WeakComponentBase.cs
+@@ -76,6 +76,7 @@ public class WeakComponentBase : WeakBase, XComponent
+     
+     ~WeakComponentBase()
+     {
++        Console.WriteLine("~WeakComponentBase()");
+         bool doDispose;
+         lock (this)
+         {
+@@ -109,6 +110,7 @@ public class WeakComponentBase : WeakBase, XComponent
+     */
+     public void dispose()
+     {
++        Console.WriteLine("dispose -> " + this );
+         // Determine in a thread-safe way if this is the first call to this
+         // method.  Only then we proceed with the notification of event
+         // listeners.  It is an error to call this method more then once.


More information about the ooo-build-commit mailing list