Author: martin
Date: 2006-04-17 11:37:06 -0400 (Mon, 17 Apr 2006)
New Revision: 59540
Modified:
trunk/debugger/ChangeLog
trunk/debugger/frontend/Interpreter.cs
trunk/debugger/test/testsuite/NUnit.cs
Log:
2006-04-17 Martin Baulig <[EMAIL PROTECTED]>
* frontend/Interpreter.cs: Cosmetic cleanups in the
process-related messages.
Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog 2006-04-17 15:36:40 UTC (rev 59539)
+++ trunk/debugger/ChangeLog 2006-04-17 15:37:06 UTC (rev 59540)
@@ -1,5 +1,10 @@
2006-04-17 Martin Baulig <[EMAIL PROTECTED]>
+ * frontend/Interpreter.cs: Cosmetic cleanups in the
+ process-related messages.
+
+2006-04-17 Martin Baulig <[EMAIL PROTECTED]>
+
* backends/SingleSteppingEngine.cs
(SingleSteppingEngine.AcquireGlobalThreadLock): Check the
`stop_event' and don't do anything if we just died.
Modified: trunk/debugger/frontend/Interpreter.cs
===================================================================
--- trunk/debugger/frontend/Interpreter.cs 2006-04-17 15:36:40 UTC (rev
59539)
+++ trunk/debugger/frontend/Interpreter.cs 2006-04-17 15:37:06 UTC (rev
59540)
@@ -418,8 +418,8 @@
protected void ThreadCreated (Thread thread)
{
if (!thread.IsDaemon)
- Print ("Process {0} created new thread @{1}.",
- PrintProcess (thread.Process),
thread.ID);
+ Print ("Process #{0} created new thread @{1}.",
+ thread.Process.ID, thread.ID);
}
public void Wait (Thread thread)
@@ -489,7 +489,7 @@
protected void ProcessCreated (Process process)
{
- Print ("Created new process {0}.", PrintProcess
(process));
+ Print ("Created new process #{0}.", process.ID);
if (current_process == null) {
current_process = process;
current_thread = process.MainThread;
@@ -498,7 +498,7 @@
protected void ProcessExited (Process process)
{
- Print ("Process {0} exited.", PrintProcess (process));
+ Print ("Process #{0} exited.", process.ID);
if (process == main_process) {
session.MainProcessExited (process);
current_process = main_process = null;
@@ -511,7 +511,8 @@
protected void ProcessExecd (Process process)
{
- Print ("Process {0} exec()'d.", PrintProcess (process));
+ Print ("Process #{0} exec()'d: {1}", process.ID,
+ PrintCommandLineArgs (process));
}
public Thread CurrentThread {
@@ -728,18 +729,28 @@
}
}
- public string PrintProcess (Process process)
+ public string PrintCommandLineArgs (Process process)
{
- bool first = true;
StringBuilder sb = new StringBuilder ();
- foreach (string arg in process.CommandLineArguments) {
- if (first)
- first = false;
+ string[] args = process.CommandLineArguments;
+ int start = 0;
+ if ((args.Length > 1) && (args [0] == BuildInfo.mono)) {
+ if (args [1] == "--inside-mdb")
+ start = 2;
else
+ start = 1;
+ }
+ for (int i = start; i < args.Length; i++) {
+ if (i > start)
sb.Append (" ");
- sb.Append (arg);
+ sb.Append (args [i]);
}
- string command_line = sb.ToString ();
+ return sb.ToString ();
+ }
+
+ public string PrintProcess (Process process)
+ {
+ string command_line = PrintCommandLineArgs (process);
if (command_line.Length > 70) {
command_line = command_line.Substring (0, 70);
command_line += " ...";
@@ -812,6 +823,7 @@
backend.TargetExitedEvent += target_exited;
backend.ThreadCreatedEvent += thread_created;
+ backend.ThreadExitedEvent += thread_exited;
backend.ProcessCreatedEvent += process_created;
backend.ProcessExitedEvent += process_exited;
backend.ProcessExecdEvent += process_execd;
@@ -823,6 +835,11 @@
interpreter.ThreadCreated (thread);
}
+ public void thread_exited (Debugger debugger, Thread
thread)
+ {
+ interpreter.ThreadExited (thread);
+ }
+
public void process_created (Debugger debugger, Process
process)
{
interpreter.ProcessCreated (process);
@@ -864,9 +881,6 @@
public void target_event (Thread thread,
TargetEventArgs args)
{
interpreter.Style.TargetEvent (thread, args);
- if ((args.Type == TargetEventType.TargetExited)
||
- (args.Type ==
TargetEventType.TargetSignaled))
- interpreter.ThreadExited (thread);
}
}
}
Modified: trunk/debugger/test/testsuite/NUnit.cs
===================================================================
--- trunk/debugger/test/testsuite/NUnit.cs 2006-04-17 15:36:40 UTC (rev
59539)
+++ trunk/debugger/test/testsuite/NUnit.cs 2006-04-17 15:37:06 UTC (rev
59540)
@@ -32,10 +32,10 @@
static Regex frame_regex = new Regex (@"^#([0-9]+):
0x[0-9A-Fa-f]+ in (.*)$");
static Regex func_source_regex = new Regex (@"^(.*) at
(.*):([0-9]+)$");
static Regex func_offset_regex = new Regex
(@"^(.*)\+0x([0-9A-Fa-f]+)$");
- static Regex process_created_regex = new Regex (@"^Created new
process #([0-9]+) \(([0-9]+):(.*)\)\.$");
- static Regex thread_created_regex = new Regex (@"^Process
#([0-9]+) \(([0-9]+):(.*)\) created new thread @([0-9]+)\.$");
- static Regex process_execd_regex = new Regex (@"^Process
#([0-9]+) \(([0-9]+):(.*)\) exec\(\)'d\.$");
- static Regex process_exited_regex = new Regex (@"^Process
#([0-9]+) \(([0-9]+):(.*)\) exited\.$");
+ static Regex process_created_regex = new Regex (@"^Created new
process #([0-9]+)\.$");
+ static Regex thread_created_regex = new Regex (@"^Process
#([0-9]+) created new thread @([0-9]+)\.$");
+ static Regex process_execd_regex = new Regex (@"^Process
#([0-9]+) exec\(\)'d\: (.*)$");
+ static Regex process_exited_regex = new Regex (@"^Process
#([0-9]+) exited\.$");
protected TestSuite (string application)
@@ -421,7 +421,7 @@
if (!match.Success)
Assert.Fail ("Failed to created process
(received `{0}').", output);
- int id = Int32.Parse (match.Groups [4].Value);
+ int id = Int32.Parse (match.Groups [2].Value);
return interpreter.GetThread (id);
}
@@ -462,7 +462,7 @@
if (!match.Success)
Assert.Fail ("Process failed to exec()
(received `{0}').", output);
- int id = Int32.Parse (match.Groups [4].Value);
+ int id = Int32.Parse (match.Groups [2].Value);
return interpreter.GetThread (id);
}
@@ -504,7 +504,7 @@
if (!match.Success)
Assert.Fail ("Process failed to exec()
(received `{0}').", output);
- int id = Int32.Parse (match.Groups [4].Value);
+ int id = Int32.Parse (match.Groups [2].Value);
return interpreter.GetThread (id);
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches