Author: martin
Date: 2006-04-17 22:01:25 -0400 (Mon, 17 Apr 2006)
New Revision: 59569
Added:
trunk/debugger/backends/EventQueue.cs
Removed:
trunk/debugger/backends/classes/EventQueue.cs
trunk/debugger/classes/ObjectContainer.cs
trunk/debugger/classes/Threading.cs
Modified:
trunk/debugger/ChangeLog
trunk/debugger/classes/ObjectCache.cs
trunk/debugger/classes/SymbolTableManager.cs
Log:
2006-04-18 Martin Baulig <[EMAIL PROTECTED]>
* backends/EventQueue.cs: New file; merged classes/Threading.cs
and backends/classes/EventQueue.cs here.
* classes/ObjectContainer.cs: Removed.
Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog 2006-04-18 01:52:39 UTC (rev 59568)
+++ trunk/debugger/ChangeLog 2006-04-18 02:01:25 UTC (rev 59569)
@@ -1,5 +1,12 @@
2006-04-18 Martin Baulig <[EMAIL PROTECTED]>
+ * backends/EventQueue.cs: New file; merged classes/Threading.cs
+ and backends/classes/EventQueue.cs here.
+
+ * classes/ObjectContainer.cs: Removed.
+
+2006-04-18 Martin Baulig <[EMAIL PROTECTED]>
+
* classes/BreakpointHandle.cs: Moved into ../backends/.
* backends/BreakpointHandle.cs: Moved here from ../classes/.
Copied: trunk/debugger/backends/EventQueue.cs (from rev 59549,
trunk/debugger/backends/classes/EventQueue.cs)
===================================================================
--- trunk/debugger/backends/classes/EventQueue.cs 2006-04-17 22:30:24 UTC
(rev 59549)
+++ trunk/debugger/backends/EventQueue.cs 2006-04-18 02:01:25 UTC (rev
59569)
@@ -0,0 +1,120 @@
+using System;
+using System.Threading;
+using System.Runtime.InteropServices;
+
+namespace Mono.Debugger.Backends
+{
+ internal abstract class DebuggerWaitHandle
+ {
+ public readonly string Name;
+ public DebugFlags DebugFlags = DebugFlags.Mutex;
+
+ [DllImport("monodebuggerserver")]
+ static extern int mono_debugger_server_get_current_pid ();
+
+ [DllImport("monodebuggerserver")]
+ static extern long mono_debugger_server_get_current_thread ();
+
+ protected DebuggerWaitHandle (string name)
+ {
+ this.Name = name;
+ }
+
+ public static string CurrentThread {
+ get {
+ int pid = mono_debugger_server_get_current_pid
();
+ long thread =
mono_debugger_server_get_current_thread ();
+ return String.Format ("[{0}:{1}:0x{2:x}]",
+ Environment.MachineName,
pid, thread);
+ }
+ }
+
+ public abstract bool TryLock ();
+
+ protected void Debug (string format, params object[] args)
+ {
+ Report.Debug (DebugFlags, format, args);
+ }
+ }
+
+ internal class DebuggerMutex : DebuggerWaitHandle
+ {
+ protected new IntPtr handle;
+
+ [DllImport("monodebuggerserver")]
+ static extern IntPtr mono_debugger_mutex_new ();
+
+ [DllImport("monodebuggerserver")]
+ static extern void mono_debugger_mutex_lock (IntPtr handle);
+
+ [DllImport("monodebuggerserver")]
+ static extern void mono_debugger_mutex_unlock (IntPtr handle);
+
+ [DllImport("monodebuggerserver")]
+ static extern bool mono_debugger_mutex_trylock (IntPtr handle);
+
+ public DebuggerMutex (string name)
+ : base (name)
+ {
+ handle = mono_debugger_mutex_new ();
+ }
+
+ public void Lock ()
+ {
+ Debug ("{0} locking {1}", CurrentThread, Name);
+ mono_debugger_mutex_lock (handle);
+ Debug ("{0} locked {1}", CurrentThread, Name);
+ }
+
+ public void Unlock ()
+ {
+ Debug ("{0} unlocking {1}", CurrentThread, Name);
+ mono_debugger_mutex_unlock (handle);
+ Debug ("{0} unlocked {1}", CurrentThread, Name);
+ }
+
+ public override bool TryLock ()
+ {
+ Debug ("{0} trying to lock {1}", CurrentThread, Name);
+ bool success = mono_debugger_mutex_trylock (handle);
+ if (success)
+ Debug ("{0} locked {1}", CurrentThread, Name);
+ else
+ Debug ("{0} could not lock {1}", CurrentThread,
Name);
+ return success;
+ }
+ }
+
+ internal class DebuggerEventQueue : DebuggerMutex
+ {
+ IntPtr cond;
+
+ [DllImport("monodebuggerserver")]
+ static extern IntPtr mono_debugger_cond_new ();
+
+ [DllImport("monodebuggerserver")]
+ static extern void mono_debugger_cond_wait (IntPtr mutex,
IntPtr cond);
+
+ [DllImport("monodebuggerserver")]
+ static extern void mono_debugger_cond_broadcast (IntPtr cond);
+
+ public DebuggerEventQueue (string name)
+ : base (name)
+ {
+ cond = mono_debugger_cond_new ();
+ }
+
+ public void Wait ()
+ {
+ Debug ("{0} waiting {1}", CurrentThread, Name);
+ mono_debugger_cond_wait (handle, cond);
+ Debug ("{0} done waiting {1}", CurrentThread, Name);
+ }
+
+ public void Signal ()
+ {
+ Debug ("{0} signal {1}", CurrentThread, Name);
+ mono_debugger_cond_broadcast (cond);
+ }
+ }
+}
Deleted: trunk/debugger/backends/classes/EventQueue.cs
===================================================================
--- trunk/debugger/backends/classes/EventQueue.cs 2006-04-18 01:52:39 UTC
(rev 59568)
+++ trunk/debugger/backends/classes/EventQueue.cs 2006-04-18 02:01:25 UTC
(rev 59569)
@@ -1,40 +0,0 @@
-using System;
-using System.Threading;
-using System.Runtime.InteropServices;
-
-namespace Mono.Debugger.Backends
-{
- public class DebuggerEventQueue : DebuggerMutex
- {
- IntPtr cond;
-
- [DllImport("monodebuggerserver")]
- static extern IntPtr mono_debugger_cond_new ();
-
- [DllImport("monodebuggerserver")]
- static extern void mono_debugger_cond_wait (IntPtr mutex,
IntPtr cond);
-
- [DllImport("monodebuggerserver")]
- static extern void mono_debugger_cond_broadcast (IntPtr cond);
-
- public DebuggerEventQueue (string name)
- : base (name)
- {
- cond = mono_debugger_cond_new ();
- }
-
- public void Wait ()
- {
- Debug ("{0} waiting {1}", CurrentThread, Name);
- mono_debugger_cond_wait (handle, cond);
- Debug ("{0} done waiting {1}", CurrentThread, Name);
- }
-
- public void Signal ()
- {
- Debug ("{0} signal {1}", CurrentThread, Name);
- mono_debugger_cond_broadcast (cond);
- }
- }
-
-}
Modified: trunk/debugger/classes/ObjectCache.cs
===================================================================
--- trunk/debugger/classes/ObjectCache.cs 2006-04-18 01:52:39 UTC (rev
59568)
+++ trunk/debugger/classes/ObjectCache.cs 2006-04-18 02:01:25 UTC (rev
59569)
@@ -3,11 +3,13 @@
using System.Collections;
using System.Runtime.InteropServices;
+using Mono.Debugger.Backends;
+
namespace Mono.Debugger
{
public delegate object ObjectCacheFunc (object user_data);
- public class ObjectCache : IDisposable
+ internal class ObjectCache : IDisposable
{
WeakReference weak_reference;
ObjectCacheFunc func;
Deleted: trunk/debugger/classes/ObjectContainer.cs
===================================================================
--- trunk/debugger/classes/ObjectContainer.cs 2006-04-18 01:52:39 UTC (rev
59568)
+++ trunk/debugger/classes/ObjectContainer.cs 2006-04-18 02:01:25 UTC (rev
59569)
@@ -1,63 +0,0 @@
-using System;
-using System.Threading;
-using System.Collections;
-using System.Runtime.InteropServices;
-
-namespace Mono.Debugger
-{
- public class ObjectContainer : IDisposable
- {
- ArrayList objects = new ArrayList ();
-
- public void AddObject (ObjectCache data)
- {
- check_disposed ();
- objects.Add (data);
- }
-
- //
- // IDisposable
- //
-
- private void check_disposed ()
- {
- if (disposed)
- throw new ObjectDisposedException ("Inferior");
- }
-
- private bool disposed = false;
-
- protected virtual void Dispose (bool disposing)
- {
- // Check to see if Dispose has already been called.
- if (!this.disposed) {
- // If this is a call to Dispose,
- // dispose all managed resources.
- if (disposing) {
- foreach (ObjectCache data in objects)
- data.Dispose ();
- objects = null;
- // Do stuff here
- }
-
- this.disposed = true;
-
- lock (this) {
- // Release unmanaged resources
- }
- }
- }
-
- public void Dispose ()
- {
- Dispose (true);
- // Take yourself off the Finalization queue
- GC.SuppressFinalize (this);
- }
-
- ~ObjectContainer ()
- {
- Dispose (false);
- }
- }
-}
Modified: trunk/debugger/classes/SymbolTableManager.cs
===================================================================
--- trunk/debugger/classes/SymbolTableManager.cs 2006-04-18 01:52:39 UTC
(rev 59568)
+++ trunk/debugger/classes/SymbolTableManager.cs 2006-04-18 02:01:25 UTC
(rev 59569)
@@ -3,6 +3,8 @@
using ST = System.Threading;
using System.Runtime.InteropServices;
+using Mono.Debugger.Backends;
+
namespace Mono.Debugger
{
// <summary>
Deleted: trunk/debugger/classes/Threading.cs
===================================================================
--- trunk/debugger/classes/Threading.cs 2006-04-18 01:52:39 UTC (rev 59568)
+++ trunk/debugger/classes/Threading.cs 2006-04-18 02:01:25 UTC (rev 59569)
@@ -1,88 +0,0 @@
-using System;
-using System.Threading;
-using System.Runtime.InteropServices;
-
-namespace Mono.Debugger
-{
- public abstract class DebuggerWaitHandle
- {
- public readonly string Name;
- public DebugFlags DebugFlags = DebugFlags.Mutex;
-
- [DllImport("monodebuggerserver")]
- static extern int mono_debugger_server_get_current_pid ();
-
- [DllImport("monodebuggerserver")]
- static extern long mono_debugger_server_get_current_thread ();
-
- protected DebuggerWaitHandle (string name)
- {
- this.Name = name;
- }
-
- public static string CurrentThread {
- get {
- int pid = mono_debugger_server_get_current_pid
();
- long thread =
mono_debugger_server_get_current_thread ();
- return String.Format ("[{0}:{1}:0x{2:x}]",
- Environment.MachineName,
pid, thread);
- }
- }
-
- public abstract bool TryLock ();
-
- protected void Debug (string format, params object[] args)
- {
- Report.Debug (DebugFlags, format, args);
- }
- }
-
- public class DebuggerMutex : DebuggerWaitHandle
- {
- protected new IntPtr handle;
-
- [DllImport("monodebuggerserver")]
- static extern IntPtr mono_debugger_mutex_new ();
-
- [DllImport("monodebuggerserver")]
- static extern void mono_debugger_mutex_lock (IntPtr handle);
-
- [DllImport("monodebuggerserver")]
- static extern void mono_debugger_mutex_unlock (IntPtr handle);
-
- [DllImport("monodebuggerserver")]
- static extern bool mono_debugger_mutex_trylock (IntPtr handle);
-
- public DebuggerMutex (string name)
- : base (name)
- {
- handle = mono_debugger_mutex_new ();
- }
-
- public void Lock ()
- {
- Debug ("{0} locking {1}", CurrentThread, Name);
- mono_debugger_mutex_lock (handle);
- Debug ("{0} locked {1}", CurrentThread, Name);
- }
-
- public void Unlock ()
- {
- Debug ("{0} unlocking {1}", CurrentThread, Name);
- mono_debugger_mutex_unlock (handle);
- Debug ("{0} unlocked {1}", CurrentThread, Name);
- }
-
- public override bool TryLock ()
- {
- Debug ("{0} trying to lock {1}", CurrentThread, Name);
- bool success = mono_debugger_mutex_trylock (handle);
- if (success)
- Debug ("{0} locked {1}", CurrentThread, Name);
- else
- Debug ("{0} could not lock {1}", CurrentThread,
Name);
- return success;
- }
- }
-
-}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches