[Monodevelop-patches-list] r1109 - in trunk/MonoDevelop: . src/Main/Base/Services

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Thu Mar 4 14:53:06 EST 2004


Author: mkestner
Date: 2004-03-04 14:53:06 -0500 (Thu, 04 Mar 2004)
New Revision: 1109

Modified:
   trunk/MonoDevelop/ChangeLog
   trunk/MonoDevelop/src/Main/Base/Services/DebuggingService.cs
Log:
2004-03-04  Mike Kestner  <mkestner at ximian.com>

	* Main/Base/Services/DebuggingService.cs : add Pause/Resume and make
	IsRunning public.



Modified: trunk/MonoDevelop/ChangeLog
===================================================================
--- trunk/MonoDevelop/ChangeLog	2004-03-04 19:29:21 UTC (rev 1108)
+++ trunk/MonoDevelop/ChangeLog	2004-03-04 19:53:06 UTC (rev 1109)
@@ -1,3 +1,8 @@
+2004-03-04  Mike Kestner  <mkestner at ximian.com>
+
+	* Main/Base/Services/DebuggingService.cs : add Pause/Resume and make
+	IsRunning public.
+
 2004-03-04  Todd Berman  <tberman at sevenl.net>
 
 	* build/AddIns/SharpDevelopCore.addin: adding debug menu.

Modified: trunk/MonoDevelop/src/Main/Base/Services/DebuggingService.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Services/DebuggingService.cs	2004-03-04 19:29:21 UTC (rev 1108)
+++ trunk/MonoDevelop/src/Main/Base/Services/DebuggingService.cs	2004-03-04 19:53:06 UTC (rev 1109)
@@ -34,14 +34,19 @@
 			DebuggerBackend.Initialize ();
 		}
 		
+		void Cleanup ()
+		{
+			if (!Debugging)
+				return;
+
+			backend.Dispose ();
+			backend = null;
+			proc = null;
+		}
+
 		public override void UnloadService ()
 		{
-			if (Debugging) {
-				backend.Dispose ();
-				backend = null;
-				proc = null;
-			}
-
+			Cleanup ();
 			base.UnloadService ();
 		}
 
@@ -51,7 +56,7 @@
 			}
 		}
 
-		private bool IsRunning {
+		public bool IsRunning {
 			get {
 				return Debugging && !proc.IsStopped;
 			}
@@ -103,17 +108,6 @@
 			return true;
 		}
 
-		public void ToggleRunning ()
-		{
-			if (!Debugging)
-				return;
-
-			if (proc.IsStopped)
-				proc.Continue (false);
-			else
-				proc.Stop ();
-		}
-
 		private void initialized_event (ThreadManager manager, Process process)
 		{
 			this.proc = process;
@@ -125,15 +119,14 @@
 				string[] toks = point.Name.Split (':');
 				string filename = toks [0];
 				int linenumber = Int32.Parse (toks [1]);
-				Console.WriteLine ("Looking up " + filename + " " + linenumber);
 				SourceLocation loc = backend.FindLocation(filename, linenumber);
 				if (loc == null) {
-					Console.WriteLine ("Couldn't find breakpoint location " + key);
+					Console.WriteLine ("Couldn't find breakpoint location " + key + " " + backend.Modules.Length);
 					return;
 				}
 				breakpoints [key] = loc.InsertBreakpoint (proc, point);
 				if (breakpoints [key] == null)
-					Console.WriteLine ("Couldn't insert breakpoint " + key);
+					throw new Exception ("Couldn't insert breakpoint " + key);
 			}
 
 			proc.TargetEvent += new TargetEventHandler (target_event);
@@ -155,10 +148,32 @@
 
 		bool KillApplication ()
 		{
-			UnloadService ();
+			Cleanup ();
 			return false;
 		}
 
+		public void Pause ()
+		{
+			if (!Debugging)
+				throw new Exception ("Debugger not running.");
+
+			if (proc.IsStopped)
+				return;
+
+			proc.Stop ();
+		}
+
+		public void Resume ()
+		{
+			if (!Debugging)
+				throw new Exception ("Debugger not running.");
+
+			if (!proc.IsStopped)
+				return;
+
+			proc.Continue (false);
+		}
+
 		public void Run (string[] argv)
 		{
 			if (Debugging)
@@ -179,6 +194,25 @@
 			backend = null;
 		}
 
+		public string[] Backtrace {
+			get {
+				Backtrace trace = proc.GetBacktrace ();
+				string[] result = new string [trace.Length];
+				int i = 0;
+				foreach (StackFrame frame in trace.Frames) {
+					result [i++] = frame.TargetAddress.ToString ();
+					Console.WriteLine (result [i-1]);
+				}
+
+				return result;
+			}
+		}
+
+		public string LookupValue (string expr)
+		{
+			return "";
+		}
+
 		private void OnBreakpointHit (Breakpoint pointFromDbg, StackFrame frame)
 		{
 			point = pointFromDbg;




More information about the Monodevelop-patches-list mailing list