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
void CallStackListItemActivate(object sender, EventArgs e) void CallStackListItemActivate(object sender, EventArgs e)
{ {
if (!debuggerCore.IsCurrentProcessSafeForInspection) { if (debuggerCore.IsCurrentProcessSafeForInspection) {
debuggerCore.CurrentThread.CurrentFunction = (Function)(callStackList.SelectedItems[0].Tag); 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
return; return;
case ExceptionForm.Result.Ignore: case ExceptionForm.Result.Ignore:
debugger.CurrentThread.InterceptCurrentException(); debugger.CurrentThread.InterceptCurrentException();
return; break;
} }
} else { } else {
JumpToCurrentLine(); JumpToCurrentLine();

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

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

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

@ -22,7 +22,7 @@ namespace DebuggerLibrary
NDebugger debugger; NDebugger debugger;
Module module; Module module;
ICorDebugFrame corFrame; ICorDebugILFrame corILFrame;
ICorDebugFunction corFunction; ICorDebugFunction corFunction;
MethodProps methodProps; MethodProps methodProps;
@ -65,11 +65,11 @@ namespace DebuggerLibrary
} }
} }
internal unsafe Function(NDebugger debugger, ICorDebugFrame corFrame) internal unsafe Function(NDebugger debugger, ICorDebugILFrame corILFrame)
{ {
this.debugger = debugger; this.debugger = debugger;
this.corFrame = corFrame; this.corILFrame = corILFrame;
corFrame.GetFunction(out corFunction); corILFrame.GetFunction(out corFunction);
uint functionToken; uint functionToken;
corFunction.GetToken(out functionToken); corFunction.GetToken(out functionToken);
ICorDebugModule corModule; ICorDebugModule corModule;
@ -81,9 +81,9 @@ namespace DebuggerLibrary
#region Helpping proprerties #region Helpping proprerties
internal ICorDebugILFrame corILFrame { internal ICorDebugILFrame CorILFrame {
get { get {
return (ICorDebugILFrame) corFrame; return corILFrame;
} }
} }
@ -135,7 +135,7 @@ namespace DebuggerLibrary
public void StepOut() public void StepOut()
{ {
ICorDebugStepper stepper; ICorDebugStepper stepper;
corFrame.CreateStepper(out stepper); corILFrame.CreateStepper(out stepper);
stepper.StepOut(); stepper.StepOut();
debugger.CurrentThread.AddActiveStepper(stepper); debugger.CurrentThread.AddActiveStepper(stepper);
@ -159,7 +159,7 @@ namespace DebuggerLibrary
ICorDebugStepper stepper; ICorDebugStepper stepper;
if (stepIn) { if (stepIn) {
corFrame.CreateStepper(out stepper); corILFrame.CreateStepper(out stepper);
fixed (int* ranges = nextSt.StepRanges) { fixed (int* ranges = nextSt.StepRanges) {
stepper.StepRange(1 /* true - step in*/ , (IntPtr)ranges, (uint)nextSt.StepRanges.Length / 2); stepper.StepRange(1 /* true - step in*/ , (IntPtr)ranges, (uint)nextSt.StepRanges.Length / 2);
@ -171,7 +171,7 @@ namespace DebuggerLibrary
// Mind that step in which ends in code without symblols is cotinued // Mind that step in which ends in code without symblols is cotinued
// so the next step out ensures that we atleast do step over // 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) { fixed (int* ranges = nextSt.StepRanges) {
stepper.StepRange(0 /* false - step over*/ , (IntPtr)ranges, (uint)nextSt.StepRanges.Length / 2); 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
public void InterceptCurrentException() public void InterceptCurrentException()
{ {
((ICorDebugThread2)corThread).InterceptCurrentException(LastFunction.corILFrame); ((ICorDebugThread2)corThread).InterceptCurrentException(LastFunction.CorILFrame);
process.Continue(); process.Continue();
} }
@ -213,7 +213,9 @@ namespace DebuggerLibrary
if (framesFetched == 0) break; // We are done if (framesFetched == 0) break; // We are done
try { try {
callstack.Add(new Function(debugger, corFrames[0])); if (corFrames[0] is ICorDebugILFrame) {
callstack.Add(new Function(debugger, (ICorDebugILFrame)corFrames[0]));
}
} catch (COMException) { } catch (COMException) {
// TODO // TODO
}; };

Loading…
Cancel
Save