Author: martin
Date: 2005-09-07 10:52:04 -0400 (Wed, 07 Sep 2005)
New Revision: 49637

Modified:
   trunk/debugger/ChangeLog
   trunk/debugger/backends/mono/MonoClassObject.cs
   trunk/debugger/backends/mono/MonoClassType.cs
   trunk/debugger/backends/mono/MonoFunctionObject.cs
   trunk/debugger/backends/mono/MonoFunctionType.cs
   trunk/debugger/backends/native/NativeFunctionObject.cs
   trunk/debugger/frontend/Expression.cs
   trunk/debugger/frontend/ScriptingContext.cs
   trunk/debugger/interfaces/ITargetFunctionObject.cs
Log:
2005-09-07  Martin Baulig  <[EMAIL PROTECTED]>

        * interfaces/ITargetFunctionObject.cs
        (ITargetFunctionObject.Invoke): Removed the `bool debug' argument.



Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog    2005-09-07 14:37:56 UTC (rev 49636)
+++ trunk/debugger/ChangeLog    2005-09-07 14:52:04 UTC (rev 49637)
@@ -1,5 +1,10 @@
 2005-09-07  Martin Baulig  <[EMAIL PROTECTED]>
 
+       * interfaces/ITargetFunctionObject.cs
+       (ITargetFunctionObject.Invoke): Removed the `bool debug' argument.
+
+2005-09-07  Martin Baulig  <[EMAIL PROTECTED]>
+
        * interfaces/ITargetMemoryAccess.cs
        (ITargetAccess.RuntimeInvoke): Take an `ITargetFunctionObject'
        instead of a `TargetAddress'.

Modified: trunk/debugger/backends/mono/MonoClassObject.cs
===================================================================
--- trunk/debugger/backends/mono/MonoClassObject.cs     2005-09-07 14:37:56 UTC 
(rev 49636)
+++ trunk/debugger/backends/mono/MonoClassObject.cs     2005-09-07 14:52:04 UTC 
(rev 49637)
@@ -79,7 +79,7 @@
 
                        try {
                                ITargetObject retval = func.Invoke (
-                                       location.TargetAccess, this, args, 
false);
+                                       location.TargetAccess, this, args);
 
                                return retval.Print();
                        }

Modified: trunk/debugger/backends/mono/MonoClassType.cs
===================================================================
--- trunk/debugger/backends/mono/MonoClassType.cs       2005-09-07 14:37:56 UTC 
(rev 49636)
+++ trunk/debugger/backends/mono/MonoClassType.cs       2005-09-07 14:52:04 UTC 
(rev 49637)
@@ -280,7 +280,7 @@
                                ITargetAccess target = 
instance.Location.TargetAccess;
                                ITargetFunctionObject func = 
CreateFunctionObject (
                                        target, properties [index].Getter);
-                               return func.Invoke (target, instance, new 
ITargetObject [0], false);
+                               return func.Invoke (target, instance, new 
ITargetObject [0]);
                        } catch (TargetException ex) {
                                throw new LocationInvalidException (ex);
                        }
@@ -292,7 +292,7 @@
                                get_properties ();
                                ITargetFunctionObject func = 
CreateFunctionObject (
                                        target, static_properties 
[index].Getter);
-                               return func.Invoke (target, null, new 
ITargetObject [0], false);
+                               return func.Invoke (target, null, new 
ITargetObject [0]);
                        } catch (TargetException ex) {
                                throw new LocationInvalidException (ex);
                        }

Modified: trunk/debugger/backends/mono/MonoFunctionObject.cs
===================================================================
--- trunk/debugger/backends/mono/MonoFunctionObject.cs  2005-09-07 14:37:56 UTC 
(rev 49636)
+++ trunk/debugger/backends/mono/MonoFunctionObject.cs  2005-09-07 14:52:04 UTC 
(rev 49637)
@@ -23,11 +23,11 @@
                }
 
                public ITargetObject Invoke (ITargetAccess target, 
ITargetObject instance,
-                                            ITargetObject[] args, bool debug)
+                                            ITargetObject[] args)
                {
                        MonoObject[] margs = new MonoObject [args.Length];
                        args.CopyTo (margs, 0);
-                       return type.Invoke (target, this, (MonoObject) 
instance, margs, debug);
+                       return type.Invoke (target, this, (MonoObject) 
instance, margs);
                }
        }
 }

Modified: trunk/debugger/backends/mono/MonoFunctionType.cs
===================================================================
--- trunk/debugger/backends/mono/MonoFunctionType.cs    2005-09-07 14:37:56 UTC 
(rev 49636)
+++ trunk/debugger/backends/mono/MonoFunctionType.cs    2005-09-07 14:52:04 UTC 
(rev 49637)
@@ -80,16 +80,11 @@
                }
 
                internal ITargetObject Invoke (ITargetAccess target, 
MonoFunctionObject method,
-                                              MonoObject instance, 
MonoObject[] args, bool debug)
+                                              MonoObject instance, 
MonoObject[] args)
                {
                        if (ParameterTypes.Length != args.Length)
                                throw new ArgumentException ();
 
-                       if (debug) {
-                               target.RuntimeInvoke (method, instance, args);
-                               return null;
-                       }
-
                        string exc_message;
                        ITargetObject retval = target.RuntimeInvoke (
                                method, instance, args, out exc_message);

Modified: trunk/debugger/backends/native/NativeFunctionObject.cs
===================================================================
--- trunk/debugger/backends/native/NativeFunctionObject.cs      2005-09-07 
14:37:56 UTC (rev 49636)
+++ trunk/debugger/backends/native/NativeFunctionObject.cs      2005-09-07 
14:52:04 UTC (rev 49637)
@@ -19,7 +19,7 @@
                }
 
                public ITargetObject Invoke (ITargetAccess target, 
ITargetObject instance,
-                                            ITargetObject[] args, bool debug)
+                                            ITargetObject[] args)
                {
                        throw new NotSupportedException ();
                }

Modified: trunk/debugger/frontend/Expression.cs
===================================================================
--- trunk/debugger/frontend/Expression.cs       2005-09-07 14:37:56 UTC (rev 
49636)
+++ trunk/debugger/frontend/Expression.cs       2005-09-07 14:52:04 UTC (rev 
49637)
@@ -2065,16 +2065,31 @@
                        for (int i = 0; i < args.Length; i++)
                                objs [i] = args [i].EvaluateVariable (context);
 
+                       ITargetObject instance = mg.InstanceObject;
+
                        try {
-                               ITargetObject retval = func.Invoke (
-                                       
context.CurrentFrame.Frame.TargetAccess, mg.InstanceObject,
-                                       objs, debug);
-                               if (!debug && !func.Type.HasReturnValue)
-                                       throw new ScriptingException ("Method 
`{0}' doesn't return a value.", Name);
+                               if (debug) {
+                                       context.CurrentProcess.RuntimeInvoke 
(func, instance, objs);
+                                       return null;
+                               }
 
+                               string exc_message;
+                               ITargetObject retval = 
context.CurrentProcess.RuntimeInvoke (
+                                       func, mg.InstanceObject, objs, out 
exc_message);
+
+                               if (exc_message != null)
+                                       throw new ScriptingException (
+                                               "Invocation of `{0}' raised an 
exception: {1}",
+                                               Name, exc_message);
+
+                               if (!func.Type.HasReturnValue)
+                                       throw new ScriptingException (
+                                               "Method `{0}' doesn't return a 
value.", Name);
+
                                return retval;
-                       } catch (TargetInvocationException ex) {
-                               throw new ScriptingException ("Invocation of 
`{0}' raised an exception: {1}", Name, ex.Message);
+                       } catch (TargetException ex) {
+                               throw new ScriptingException (
+                                       "Invocation of `{0}' raised an 
exception: {1}", Name, ex.Message);
                        }
                }
        }
@@ -2163,7 +2178,7 @@
 
                        try {
                                return ctor.Invoke (
-                                       frame.Frame.TargetAccess, null, args, 
debug);
+                                       frame.Frame.TargetAccess, null, args);
                        } catch (TargetInvocationException ex) {
                                throw new ScriptingException (
                                        "Invocation of type `{0}'s constructor 
raised an " +

Modified: trunk/debugger/frontend/ScriptingContext.cs
===================================================================
--- trunk/debugger/frontend/ScriptingContext.cs 2005-09-07 14:37:56 UTC (rev 
49636)
+++ trunk/debugger/frontend/ScriptingContext.cs 2005-09-07 14:52:04 UTC (rev 
49637)
@@ -440,6 +440,36 @@
                                interpreter.DebuggerManager.Wait (process);
                }
 
+               public void RuntimeInvoke (ITargetFunctionObject func,
+                                          ITargetObject instance, 
ITargetObject[] args)
+               {
+                       if (process == null)
+                               throw new ScriptingException ("{0} not 
running.", Name);
+                       else if (!process.CanRun)
+                               throw new ScriptingException ("{0} cannot be 
executed.", Name);
+
+                       current_exception = null;
+
+                       process.RuntimeInvoke (func, instance, args);
+
+                       if (interpreter.IsSynchronous)
+                               interpreter.DebuggerManager.Wait (process);
+               }
+
+               public ITargetObject RuntimeInvoke (ITargetFunctionObject func,
+                                                   ITargetObject instance, 
ITargetObject[] args,
+                                                   out string exc_message)
+               {
+                       if (process == null)
+                               throw new ScriptingException ("{0} not 
running.", Name);
+                       else if (!process.CanRun)
+                               throw new ScriptingException ("{0} cannot be 
executed.", Name);
+
+                       current_exception = null;
+
+                       return process.RuntimeInvoke (func, instance, args, out 
exc_message);
+               }
+
                public void Stop ()
                {
                        if (process == null)

Modified: trunk/debugger/interfaces/ITargetFunctionObject.cs
===================================================================
--- trunk/debugger/interfaces/ITargetFunctionObject.cs  2005-09-07 14:37:56 UTC 
(rev 49636)
+++ trunk/debugger/interfaces/ITargetFunctionObject.cs  2005-09-07 14:52:04 UTC 
(rev 49637)
@@ -7,6 +7,6 @@
                }
 
                ITargetObject Invoke (ITargetAccess target, ITargetObject 
instance,
-                                     ITargetObject[] args, bool debug);
+                                     ITargetObject[] args);
        }
 }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to