Browse Source

Some error checking, Debugger.Interop update

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@222 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
342faab715
  1. 6
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs
  2. 5
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs
  3. 21
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Process.cs
  4. BIN
      src/AddIns/Misc/Debugger/Debugger.Core/RequiredLibraries/Debugger.Interop.dll
  5. BIN
      src/AddIns/Misc/Debugger/Debugger.Core/RequiredLibraries/Debugger.Interop.pdb
  6. 4
      src/AddIns/Misc/Debugger/Debugger.Interop/Project/Src/DebuggerInterop.Core.il

6
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/NDebugger.cs

@ -285,7 +285,11 @@ namespace DebuggerLibrary @@ -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;
}
}
}

5
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Modules/Module.cs

@ -132,6 +132,11 @@ namespace DebuggerLibrary @@ -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) {

21
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Process.cs

@ -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(

BIN
src/AddIns/Misc/Debugger/Debugger.Core/RequiredLibraries/Debugger.Interop.dll

Binary file not shown.

BIN
src/AddIns/Misc/Debugger/Debugger.Core/RequiredLibraries/Debugger.Interop.pdb

Binary file not shown.

4
src/AddIns/Misc/Debugger/Debugger.Interop/Project/Src/DebuggerInterop.Core.il

@ -3599,9 +3599,9 @@ @@ -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

Loading…
Cancel
Save