Author: martin
Date: 2007-02-23 10:58:54 -0500 (Fri, 23 Feb 2007)
New Revision: 73371

Modified:
   trunk/debugger/ChangeLog
   trunk/debugger/backend/ProcessServant.cs
   trunk/debugger/classes/DebuggerConfiguration.xsd
   trunk/debugger/classes/DebuggerSession.cs
   trunk/debugger/classes/ExceptionCatchPoint.cs
Log:
2007-02-23  Martin Baulig  <[EMAIL PROTECTED]>

        * classes/ExceptionCatchPoint.cs
        (ExceptionCatchPoint): Make this persistent.



Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog    2007-02-23 15:50:50 UTC (rev 73370)
+++ trunk/debugger/ChangeLog    2007-02-23 15:58:54 UTC (rev 73371)
@@ -1,3 +1,8 @@
+2007-02-23  Martin Baulig  <[EMAIL PROTECTED]>
+
+       * classes/ExceptionCatchPoint.cs
+       (ExceptionCatchPoint): Make this persistent.
+
 2007-02-22  Martin Baulig  <[EMAIL PROTECTED]>
 
        * classes/Event.cs

Modified: trunk/debugger/backend/ProcessServant.cs
===================================================================
--- trunk/debugger/backend/ProcessServant.cs    2007-02-23 15:50:50 UTC (rev 
73370)
+++ trunk/debugger/backend/ProcessServant.cs    2007-02-23 15:58:54 UTC (rev 
73371)
@@ -291,6 +291,7 @@
                {
                        thread_hash.Remove (thread.PID);
                        thread.ThreadGroup.RemoveThread (thread.ID);
+                       session.DeleteThreadGroup (thread.ThreadGroup.Name);
                        manager.Debugger.OnThreadExitedEvent (thread.Client);
 
                        if (thread_hash.Count == 0)

Modified: trunk/debugger/classes/DebuggerConfiguration.xsd
===================================================================
--- trunk/debugger/classes/DebuggerConfiguration.xsd    2007-02-23 15:50:50 UTC 
(rev 73370)
+++ trunk/debugger/classes/DebuggerConfiguration.xsd    2007-02-23 15:58:54 UTC 
(rev 73371)
@@ -69,9 +69,13 @@
     </xs:choice>
     <xs:attribute name="name" type="xs:string" use="required" />
   </xs:complexType>
+  <xs:complexType name="Exception">
+    <xs:attribute name="type" type="xs:string" use="required" />
+  </xs:complexType>
   <xs:complexType name="Breakpoint">
     <xs:choice>
       <xs:element name="Location" type="Location" />
+      <xs:element name="Exception" type="Exception" />
     </xs:choice>
     <xs:attribute name="index" type="xs:integer" use="required" />
     <xs:attribute name="type" type="xs:string" use="required" />

Modified: trunk/debugger/classes/DebuggerSession.cs
===================================================================
--- trunk/debugger/classes/DebuggerSession.cs   2007-02-23 15:50:50 UTC (rev 
73370)
+++ trunk/debugger/classes/DebuggerSession.cs   2007-02-23 15:58:54 UTC (rev 
73371)
@@ -254,23 +254,34 @@
                                else
                                        group = CreateThreadGroup (gname);
 
-                               SourceLocation location = null;
+                               Event e = null;
 
                                XPathNodeIterator children = 
event_iter.Current.SelectChildren (
                                        XPathNodeType.Element);
-                               while (children.MoveNext ()) {
-                                       if (children.Current.Name == "Location")
-                                               location = new SourceLocation 
(this, children.Current);
-                                       else
-                                               throw new InternalError ();
-                               }
 
-                               Breakpoint bpt = new SourceBreakpoint (this, 
index, group, location);
-                               bpt.IsEnabled = enabled;
-                               AddEvent (bpt);
+                               if (!children.MoveNext ())
+                                       throw new InternalError ();
+                               e = ParseEvent (children.Current, index, group);
+                               if (children.MoveNext ())
+                                       throw new InternalError ();
+
+                               e.IsEnabled = enabled;
+                               AddEvent (e);
                        }
                }
 
+               protected Event ParseEvent (XPathNavigator navigator, int 
index, ThreadGroup group)
+               {
+                       if (navigator.Name == "Location") {
+                               SourceLocation location = new SourceLocation 
(this, navigator);
+                               return new SourceBreakpoint (this, index, 
group, location);
+                       } else if (navigator.Name == "Exception") {
+                               string exc = navigator.GetAttribute ("type", 
"");
+                               return new ExceptionCatchPoint (index, group, 
exc);
+                       } else
+                               throw new InternalError ();
+               }
+
                //
                // Modules.
                //

Modified: trunk/debugger/classes/ExceptionCatchPoint.cs
===================================================================
--- trunk/debugger/classes/ExceptionCatchPoint.cs       2007-02-23 15:50:50 UTC 
(rev 73370)
+++ trunk/debugger/classes/ExceptionCatchPoint.cs       2007-02-23 15:58:54 UTC 
(rev 73371)
@@ -13,7 +13,7 @@
                int handle = -1;
 
                public override bool IsPersistent {
-                       get { return false; }
+                       get { return true; }
                }
 
                internal ExceptionCatchPoint (ThreadGroup group, TargetType 
exception)
@@ -22,6 +22,10 @@
                        this.exception = exception;
                }
 
+               internal ExceptionCatchPoint (int index, ThreadGroup group, 
string name)
+                       : base (EventType.CatchException, index, name, group)
+               { }
+
                internal override void Enable (Thread target)
                {
                        lock (this) {
@@ -38,6 +42,7 @@
 
                internal override void OnTargetExited ()
                {
+                       exception = null;
                        handle = -1;
                }
 
@@ -83,16 +88,25 @@
 
                internal bool CheckException (Thread target, TargetAddress 
address)
                {
-                       TargetClassObject exc = exception.Language.CreateObject 
(target, address)
-                               as TargetClassObject;
+                       Language mono = target.Process.Servant.MonoLanguage;
+                       TargetClassObject exc = mono.CreateObject (target, 
address) as TargetClassObject;
                        if (exc == null)
                                return false; // OOOPS
 
+                       if (exception == null)
+                               exception = mono.LookupType (Name);
+                       if (exception == null)
+                               return false;
+
                        return IsSubclassOf (exc.Type, exception);
                }
 
-               protected override void GetSessionData (XmlElement element, 
XmlElement root)
-               { }
+               protected override void GetSessionData (XmlElement root, 
XmlElement element)
+               {
+                       XmlElement exception_e = 
root.OwnerDocument.CreateElement ("Exception");
+                       exception_e.SetAttribute ("type", Name);
+                       element.AppendChild (exception_e);
+               }
 
                TargetType exception;
        }

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

Reply via email to