|
|
|
@ -37,6 +37,11 @@ namespace DebuggerLibrary
@@ -37,6 +37,11 @@ namespace DebuggerLibrary
|
|
|
|
|
get { |
|
|
|
|
if (IsProcessRunning) throw new DebuggerException("Process must not be running"); |
|
|
|
|
if (currentThread != null) return currentThread; |
|
|
|
|
IList<Thread> threads = Threads; |
|
|
|
|
if (currentThread == null && threads.Count > 0) { |
|
|
|
|
currentThread = threads[0]; |
|
|
|
|
return currentThread; |
|
|
|
|
} |
|
|
|
|
throw new DebuggerException("No current thread"); |
|
|
|
|
} |
|
|
|
|
set { |
|
|
|
@ -46,6 +51,18 @@ namespace DebuggerLibrary
@@ -46,6 +51,18 @@ namespace DebuggerLibrary
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public IList<Thread> Threads { |
|
|
|
|
get { |
|
|
|
|
List<Thread> threads = new List<Thread>(); |
|
|
|
|
foreach(Thread thread in debugger.Threads) { |
|
|
|
|
if (thread.Process == this) { |
|
|
|
|
threads.Add(thread); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return threads; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static public Process CreateProcess(NDebugger debugger, string filename, string workingDirectory, string arguments) |
|
|
|
|
{ |
|
|
|
@ -74,6 +91,10 @@ namespace DebuggerLibrary
@@ -74,6 +91,10 @@ namespace DebuggerLibrary
|
|
|
|
|
|
|
|
|
|
ICorDebugProcess outProcess; |
|
|
|
|
|
|
|
|
|
if (workingDirectory == null || workingDirectory == "") { |
|
|
|
|
workingDirectory = System.IO.Path.GetDirectoryName(filename); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fixed (uint* pprocessStartupInfo = processStartupInfo) |
|
|
|
|
fixed (uint* pprocessInfo = processInfo) |
|
|
|
|
debugger.CorDebug.CreateProcess( |
|
|
|
|