Author: martin
Date: 2007-02-20 13:25:25 -0500 (Tue, 20 Feb 2007)
New Revision: 73203
Modified:
trunk/debugger/ChangeLog
trunk/debugger/classes/DebuggerSession.cs
trunk/debugger/frontend/Command.cs
Log:
2007-02-20 Martin Baulig <[EMAIL PROTECTED]>
* classes/DebuggerSession.cs
(DebuggerSession): Store the main process internally and use it's
main thread when removing events.
(DebuggerSession.DeleteEvent): Removed the `Thread' argument.
* frontend/Command.cs
(EventHandleCommand): Derive from `DebuggerCommand', not
`ThreadCommand'; the "enable", "disable" and "delete" commands now
longer require a thread to operate on - it's now also possible to
enable/disable or delete events after the target exited.
Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog 2007-02-20 18:11:22 UTC (rev 73202)
+++ trunk/debugger/ChangeLog 2007-02-20 18:25:25 UTC (rev 73203)
@@ -1,5 +1,18 @@
2007-02-20 Martin Baulig <[EMAIL PROTECTED]>
+ * classes/DebuggerSession.cs
+ (DebuggerSession): Store the main process internally and use it's
+ main thread when removing events.
+ (DebuggerSession.DeleteEvent): Removed the `Thread' argument.
+
+ * frontend/Command.cs
+ (EventHandleCommand): Derive from `DebuggerCommand', not
+ `ThreadCommand'; the "enable", "disable" and "delete" commands now
+ longer require a thread to operate on - it's now also possible to
+ enable/disable or delete events after the target exited.
+
+2007-02-20 Martin Baulig <[EMAIL PROTECTED]>
+
* classes/Event.cs
(Event.Breaks): Check `IsEnabled' as well.
(Event.Enable, Event.Disable): Make these methods internal; modify
Modified: trunk/debugger/classes/DebuggerSession.cs
===================================================================
--- trunk/debugger/classes/DebuggerSession.cs 2007-02-20 18:11:22 UTC (rev
73202)
+++ trunk/debugger/classes/DebuggerSession.cs 2007-02-20 18:25:25 UTC (rev
73203)
@@ -28,6 +28,7 @@
protected readonly Hashtable thread_groups;
protected readonly ThreadGroup main_thread_group;
+ Process main_process;
XmlDocument saved_session;
private DebuggerSession (DebuggerConfiguration config, string
name)
@@ -179,17 +180,22 @@
//
public void MainProcessReachedMain (Process process)
{
+ main_process = process;
+
foreach (Event e in events.Values) {
e.Enable (process.MainThread);
}
}
internal void OnProcessCreated (Process process)
- {
- }
+ { }
internal void OnProcessExited (Process process)
{
+ if (process != main_process)
+ return;
+
+ main_process = null;
foreach (Event e in events.Values) {
e.OnTargetExited ();
}
@@ -374,9 +380,10 @@
events.Add (handle.Index, handle);
}
- public void DeleteEvent (Thread thread, Event handle)
+ public void DeleteEvent (Event handle)
{
- handle.Remove (thread);
+ if (main_process != null)
+ handle.Remove (main_process.MainThread);
events.Remove (handle.Index);
}
}
Modified: trunk/debugger/frontend/Command.cs
===================================================================
--- trunk/debugger/frontend/Command.cs 2007-02-20 18:11:22 UTC (rev 73202)
+++ trunk/debugger/frontend/Command.cs 2007-02-20 18:25:25 UTC (rev 73203)
@@ -2047,7 +2047,7 @@
public string Documentation { get { return ""; } }
}
- public abstract class EventHandleCommand : ThreadCommand
+ public abstract class EventHandleCommand : DebuggerCommand
{
protected Event handle;
@@ -2122,7 +2122,7 @@
protected override object DoExecute (ScriptingContext context)
{
if (handle != null) {
- context.Interpreter.Session.DeleteEvent
(CurrentThread, handle);
+ context.Interpreter.Session.DeleteEvent
(handle);
} else {
Event[] hs = context.Interpreter.Session.Events;
@@ -2134,7 +2134,7 @@
// delete all breakpoints
foreach (Event h in
context.Interpreter.Session.Events)
- context.Interpreter.Session.DeleteEvent
(CurrentThread, h);
+ context.Interpreter.Session.DeleteEvent
(h);
}
return null;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches