diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs index e89617cc7d..563e17afc3 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs @@ -285,7 +285,11 @@ namespace DebuggerLibrary public SourcecodeSegment NextStatement { get { if (!IsDebugging) return null; - return CurrentProcess.CurrentThread.CurrentFunction.NextStatement; + if (CurrentProcess.CurrentThread.CurrentFunction == null) { + return null; + } else { + return CurrentProcess.CurrentThread.CurrentFunction.NextStatement; + } } } diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs index 7bb80a7f28..b39efd119a 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs @@ -132,6 +132,11 @@ namespace DebuggerLibrary } } + public void ApplyChanges(byte[] metadata, byte[] il) + { + (corModule as ICorDebugModule2).ApplyChanges((uint)metadata.Length, metadata, (uint)il.Length, il); + } + public void Dispose() { if (symReader != null) { diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Process.cs b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Process.cs index 11db1c36b4..d78ee055ae 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Process.cs +++ b/src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Process.cs @@ -37,6 +37,11 @@ namespace DebuggerLibrary get { if (IsProcessRunning) throw new DebuggerException("Process must not be running"); if (currentThread != null) return currentThread; + IList 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 } } } + + public IList Threads { + get { + List threads = new List(); + 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 ICorDebugProcess outProcess; + if (workingDirectory == null || workingDirectory == "") { + workingDirectory = System.IO.Path.GetDirectoryName(filename); + } + fixed (uint* pprocessStartupInfo = processStartupInfo) fixed (uint* pprocessInfo = processInfo) debugger.CorDebug.CreateProcess( diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/RequiredLibraries/Debugger.Interop.dll b/src/AddIns/Misc/Debugger/Debugger.Core/RequiredLibraries/Debugger.Interop.dll index b8dd73954c..f2e18efe46 100644 Binary files a/src/AddIns/Misc/Debugger/Debugger.Core/RequiredLibraries/Debugger.Interop.dll and b/src/AddIns/Misc/Debugger/Debugger.Core/RequiredLibraries/Debugger.Interop.dll differ diff --git a/src/AddIns/Misc/Debugger/Debugger.Core/RequiredLibraries/Debugger.Interop.pdb b/src/AddIns/Misc/Debugger/Debugger.Core/RequiredLibraries/Debugger.Interop.pdb index a545b6f7bb..574e03ea0d 100644 Binary files a/src/AddIns/Misc/Debugger/Debugger.Core/RequiredLibraries/Debugger.Interop.pdb and b/src/AddIns/Misc/Debugger/Debugger.Core/RequiredLibraries/Debugger.Interop.pdb differ diff --git a/src/AddIns/Misc/Debugger/Debugger.Interop/Project/Src/DebuggerInterop.Core.il b/src/AddIns/Misc/Debugger/Debugger.Interop/Project/Src/DebuggerInterop.Core.il index 13a86e7b48..5a09cc8efa 100644 --- a/src/AddIns/Misc/Debugger/Debugger.Interop/Project/Src/DebuggerInterop.Core.il +++ b/src/AddIns/Misc/Debugger/Debugger.Interop/Project/Src/DebuggerInterop.Core.il @@ -3599,9 +3599,9 @@ .method public hidebysig newslot abstract virtual instance void ApplyChanges([in] uint32 cbMetadata, - [in] uint8& pbMetadata, + [in] uint8[] marshal([]) pbMetadata, [in] uint32 cbIL, - [in] uint8& pbIL) runtime managed internalcall + [in] uint8[] marshal([]) pbIL) runtime managed internalcall { } // end of method ICorDebugModule2::ApplyChanges