Author: martin
Date: 2006-04-03 12:00:22 -0400 (Mon, 03 Apr 2006)
New Revision: 58957

Modified:
   trunk/debugger/backends/Process.cs
   trunk/debugger/frontend/Command.cs
Log:
Small fix.

Modified: trunk/debugger/backends/Process.cs
===================================================================
--- trunk/debugger/backends/Process.cs  2006-04-03 15:34:45 UTC (rev 58956)
+++ trunk/debugger/backends/Process.cs  2006-04-03 16:00:22 UTC (rev 58957)
@@ -250,7 +250,7 @@
                        new_process.main_engine = new_thread;
 
                        manager.Debugger.OnProcessCreatedEvent (new_process);
-                       OnThreadCreatedEvent (new_thread.Thread);
+                       new_process.OnThreadCreatedEvent (new_thread.Thread);
 
                        manager.AddEngine (new_thread);
                        new_thread.Start (TargetAddress.Null);

Modified: trunk/debugger/frontend/Command.cs
===================================================================
--- trunk/debugger/frontend/Command.cs  2006-04-03 15:34:45 UTC (rev 58956)
+++ trunk/debugger/frontend/Command.cs  2006-04-03 16:00:22 UTC (rev 58957)
@@ -1329,29 +1329,33 @@
                                        string prefix = process == 
context.Interpreter.MainProcess ?
                                                "(*)" : "   ";
 
-                                       bool first = true;
-                                       StringBuilder sb = new StringBuilder ();
-                                       foreach (string arg in 
process.CommandLineArguments) {
-                                               if (first)
-                                                       first = false;
-                                               else
-                                                       sb.Append (" ");
-                                               sb.Append (arg);
-                                       }
-                                       string command_line = sb.ToString ();
-                                       if (command_line.Length > 70) {
-                                               command_line = 
command_line.Substring (0, 70);
-                                               command_line += " ...";
-                                       }
-                                       context.Print ("{0} Process #{1} 
({2}:{3:x})", prefix,
-                                                      process.ID, 
process.MainThread.PID,
-                                                      command_line);
+                                       context.Print ("{0} {1}", prefix, 
PrintProcess (process));
                                        printed_something = true;
                                }
                        }
+
+                       protected string PrintProcess (Process process)
+                       {
+                               bool first = true;
+                               StringBuilder sb = new StringBuilder ();
+                               foreach (string arg in 
process.CommandLineArguments) {
+                                       if (first)
+                                               first = false;
+                                       else
+                                               sb.Append (" ");
+                                       sb.Append (arg);
+                               }
+                               string command_line = sb.ToString ();
+                               if (command_line.Length > 70) {
+                                       command_line = command_line.Substring 
(0, 70);
+                                       command_line += " ...";
+                               }
+                               return String.Format ("Process #{0} ({1}:{2})", 
process.ID,
+                                                     process.MainThread.PID, 
command_line);
+                       }
                }
 
-               private class ShowThreadsCommand : DebuggerCommand
+               private class ShowThreadsCommand : ShowProcessesCommand
                {
                        protected override void DoExecute (ScriptingContext 
context)
                        {
@@ -1360,12 +1364,14 @@
                                        current_id = 
context.Interpreter.CurrentThread.ID;
 
                                bool printed_something = false;
-                               Process process = 
context.Interpreter.MainProcess;
-                               foreach (Thread proc in process.Threads) {
-                                       string prefix = proc.ID == current_id ? 
"(*)" : "   ";
-                                       context.Print ("{0} {1} ({2}:{3:x})", 
prefix, proc,
-                                                      proc.PID, proc.TID);
-                                       printed_something = true;
+                               foreach (Process process in 
context.Interpreter.Processes) {
+                                       context.Print ("{0}:", PrintProcess 
(process));
+                                       foreach (Thread proc in 
process.Threads) {
+                                               string prefix = proc.ID == 
current_id ? "(*)" : "   ";
+                                               context.Print ("  {0} {1} 
({2}:{3:x})", prefix, proc,
+                                                              proc.PID, 
proc.TID);
+                                               printed_something = true;
+                                       }
                                }
 
                                if (!printed_something)

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

Reply via email to