Browse Source

Bugfixes - Thread and Callstack switching; unmanaged functions refused

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@254 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
1d73ae154e
  1. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs
  2. 2
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  3. 9
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs
  4. 18
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs
  5. 6
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs

2
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/CallStackPad.cs

@ -86,7 +86,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -86,7 +86,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
void CallStackListItemActivate(object sender, EventArgs e)
{
if (!debuggerCore.IsCurrentProcessSafeForInspection) {
if (debuggerCore.IsCurrentProcessSafeForInspection) {
debuggerCore.CurrentThread.CurrentFunction = (Function)(callStackList.SelectedItems[0].Tag);
}
}

2
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs

@ -367,7 +367,7 @@ namespace ICSharpCode.SharpDevelop.Services @@ -367,7 +367,7 @@ namespace ICSharpCode.SharpDevelop.Services
return;
case ExceptionForm.Result.Ignore:
debugger.CurrentThread.InterceptCurrentException();
return;
break;
}
} else {
JumpToCurrentLine();

9
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Internal/ManagedCallback.cs

@ -46,6 +46,9 @@ namespace DebuggerLibrary @@ -46,6 +46,9 @@ namespace DebuggerLibrary
Process process = debugger.GetProcess(pProcess);
process.IsProcessRunning = false;
debugger.CurrentProcess = process;
foreach(Thread t in process.Threads) {
t.CurrentFunction = null;
}
}
// Sets CurrentProcess
@ -58,6 +61,9 @@ namespace DebuggerLibrary @@ -58,6 +61,9 @@ namespace DebuggerLibrary
Process process = debugger.GetProcess(pProcess);
process.IsProcessRunning = false;
debugger.CurrentProcess = process;
foreach(Thread t in process.Threads) {
t.CurrentFunction = null;
}
}
// Sets CurrentProcess, CurrentThread and CurrentFunction
@ -71,6 +77,9 @@ namespace DebuggerLibrary @@ -71,6 +77,9 @@ namespace DebuggerLibrary
process.IsProcessRunning = false;
debugger.CurrentProcess = process;
process.CurrentThread = thread;
foreach(Thread t in process.Threads) {
t.CurrentFunction = null;
}
thread.CurrentFunction = thread.LastFunctionWithLoadedSymbols;
}

18
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs

@ -22,7 +22,7 @@ namespace DebuggerLibrary @@ -22,7 +22,7 @@ namespace DebuggerLibrary
NDebugger debugger;
Module module;
ICorDebugFrame corFrame;
ICorDebugILFrame corILFrame;
ICorDebugFunction corFunction;
MethodProps methodProps;
@ -65,11 +65,11 @@ namespace DebuggerLibrary @@ -65,11 +65,11 @@ namespace DebuggerLibrary
}
}
internal unsafe Function(NDebugger debugger, ICorDebugFrame corFrame)
internal unsafe Function(NDebugger debugger, ICorDebugILFrame corILFrame)
{
this.debugger = debugger;
this.corFrame = corFrame;
corFrame.GetFunction(out corFunction);
this.corILFrame = corILFrame;
corILFrame.GetFunction(out corFunction);
uint functionToken;
corFunction.GetToken(out functionToken);
ICorDebugModule corModule;
@ -81,9 +81,9 @@ namespace DebuggerLibrary @@ -81,9 +81,9 @@ namespace DebuggerLibrary
#region Helpping proprerties
internal ICorDebugILFrame corILFrame {
internal ICorDebugILFrame CorILFrame {
get {
return (ICorDebugILFrame) corFrame;
return corILFrame;
}
}
@ -135,7 +135,7 @@ namespace DebuggerLibrary @@ -135,7 +135,7 @@ namespace DebuggerLibrary
public void StepOut()
{
ICorDebugStepper stepper;
corFrame.CreateStepper(out stepper);
corILFrame.CreateStepper(out stepper);
stepper.StepOut();
debugger.CurrentThread.AddActiveStepper(stepper);
@ -159,7 +159,7 @@ namespace DebuggerLibrary @@ -159,7 +159,7 @@ namespace DebuggerLibrary
ICorDebugStepper stepper;
if (stepIn) {
corFrame.CreateStepper(out stepper);
corILFrame.CreateStepper(out stepper);
fixed (int* ranges = nextSt.StepRanges) {
stepper.StepRange(1 /* true - step in*/ , (IntPtr)ranges, (uint)nextSt.StepRanges.Length / 2);
@ -171,7 +171,7 @@ namespace DebuggerLibrary @@ -171,7 +171,7 @@ namespace DebuggerLibrary
// Mind that step in which ends in code without symblols is cotinued
// so the next step out ensures that we atleast do step over
corFrame.CreateStepper(out stepper);
corILFrame.CreateStepper(out stepper);
fixed (int* ranges = nextSt.StepRanges) {
stepper.StepRange(0 /* false - step over*/ , (IntPtr)ranges, (uint)nextSt.StepRanges.Length / 2);

6
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs

@ -134,7 +134,7 @@ namespace DebuggerLibrary @@ -134,7 +134,7 @@ namespace DebuggerLibrary
public void InterceptCurrentException()
{
((ICorDebugThread2)corThread).InterceptCurrentException(LastFunction.corILFrame);
((ICorDebugThread2)corThread).InterceptCurrentException(LastFunction.CorILFrame);
process.Continue();
}
@ -213,7 +213,9 @@ namespace DebuggerLibrary @@ -213,7 +213,9 @@ namespace DebuggerLibrary
if (framesFetched == 0) break; // We are done
try {
callstack.Add(new Function(debugger, corFrames[0]));
if (corFrames[0] is ICorDebugILFrame) {
callstack.Add(new Function(debugger, (ICorDebugILFrame)corFrames[0]));
}
} catch (COMException) {
// TODO
};

Loading…
Cancel
Save