From 342faab7157a35e7d60adde2e814061a8341bd29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Srbeck=C3=BD?= Date: Wed, 20 Jul 2005 20:16:41 +0000 Subject: [PATCH] Some error checking, Debugger.Interop update git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@222 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/Src/Debugger/NDebugger.cs | 6 ++++- .../Project/Src/Modules/Module.cs | 5 +++++ .../Project/Src/Threads/Process.cs | 21 ++++++++++++++++++ .../RequiredLibraries/Debugger.Interop.dll | Bin 49152 -> 49152 bytes .../RequiredLibraries/Debugger.Interop.pdb | Bin 9728 -> 9728 bytes .../Project/Src/DebuggerInterop.Core.il | 4 ++-- 6 files changed, 33 insertions(+), 3 deletions(-) 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 b8dd73954cb8b592d53e91b5642eae929db38d89..f2e18efe46ae66ba1435add6f391e385bbd32e75 100644 GIT binary patch delta 295 zcmZo@U~Xt&p3uR}vGm@=ZdpdTi7UfdPwZk~2%c=nC^K1+F`iLnb0cFtpCrR>1~Bjd zl1vP&409A17<6VaFfdNO$Y`wt)b0e5W&&beAkI+$VgUw*pkSBaf0+DM zz@L$0v#lVX6|Vvl!y`>b24;r0nv4pYBfJGfI1aO}<~t6=n=|5h%mscnU70Xde4q2= z;%k4Rl6PF)+%oNiAd4(3r|jl{6$MOuAAr7t0lwXn&#jW;g87YsVe_k1?5vy{7#Mhf QN))U&3vPJNKhc040Q_}PUH||9 delta 285 zcmZo@U~Xt&p3uR({b%yTZdpdYi7Ufd5A0%K@SbeQC^K1+F`iLmb0cFtpX3LiAP9H> zF%ttT!yE+$29;S142+X6GFs~ZwL5`inSfXqh;tNxSb%{cDA*-?YG_F(9uQ9Vis=h znRY^uMSzu4U~|NZ0w$psQ1^o@_y=MuOjHzO`mk&BuT|`8y$&^Tm} z0px&eUj!n6cAW!K7C<)pM#ogfNfI1vZAsGG5_%`|Nx12P#5I8O(vJ)nzg*F_^Z>F! z>Op3Ll44<##1$5WlVugG zq5hMYyi-98$*(+im<=k%0;D;Bc5(vg$sjfma{)2yL`S_z WN*sbWfpQi=KFp=_HcKi!X9fV$_+J|U delta 484 zcmZqhY4F*=!X>f&XR;F`0|UcGkE=T`Uz+XF738>Lm4vj#W*M$GoT5!kKq(ii80Y+= z;>5Dbn3AH>yzI$4L|rCFi>RP#L)G|+CS$0HhwFEl93>{9nG3WE z1iXOGxdmZ@$vhwla^Wr@AqR91`$k7c#z_(!Y>v5s51d>k^GUcxg7jzr)kr@wVEl4L z+tLHb2AKge6C{@kq+tML2D)01*&wwbIb^kYlN%+(IYBZYSEO!qG-li+#lj|uE7Y1N z%PLsI{S`BLvw|2r1QI4|D8hJkA|O8tII;mv