Browse Source

Bugfix: Some native methods leaked into callstack

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1292 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
22f86ac9de
  1. 4
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs
  2. 26
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Thread.cs

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

@ -111,8 +111,7 @@ namespace Debugger @@ -111,8 +111,7 @@ namespace Debugger
this.thread = thread;
this.chainIndex = chainIndex;
this.frameIndex = frameIndex;
this.corILFrame = corILFrame;
this.corILFramePauseSession = debugger.PauseSession;
this.CorILFrame = corILFrame;
corFunction = corILFrame.Function;
module = debugger.GetModule(corFunction.Module);
@ -137,6 +136,7 @@ namespace Debugger @@ -137,6 +136,7 @@ namespace Debugger
return corILFrame;
}
set {
if (value == null) throw new DebuggerException("Can not set frame to null");
corILFrame = value;
corILFramePauseSession = debugger.PauseSession;
}

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

@ -191,9 +191,11 @@ namespace Debugger @@ -191,9 +191,11 @@ namespace Debugger
foreach(ICorDebugFrame corFrame in corFrameEnum.Enumerator) {
frameIndex--;
Function function = GetFunctionFromCache(chainIndex, frameIndex, corFrame);
if (function != null) {
yield return function;
if (corFrame.Is<ICorDebugILFrame>()) {
Function function = GetFunctionFromCache(chainIndex, frameIndex, corFrame.As<ICorDebugILFrame>());
if (function != null) {
yield return function;
}
}
}
}
@ -206,7 +208,7 @@ namespace Debugger @@ -206,7 +208,7 @@ namespace Debugger
public Dictionary<uint, Function> Frames = new Dictionary<uint, Function>();
}
Function GetFunctionFromCache(uint chainIndex, uint frameIndex, ICorDebugFrame corFrame)
Function GetFunctionFromCache(uint chainIndex, uint frameIndex, ICorDebugILFrame corFrame)
{
try {
if (chainCache.ContainsKey(chainIndex) &&
@ -214,18 +216,14 @@ namespace Debugger @@ -214,18 +216,14 @@ namespace Debugger
!chainCache[chainIndex].Frames[frameIndex].HasExpired) {
Function function = chainCache[chainIndex].Frames[frameIndex];
function.CorILFrame = corFrame.As<ICorDebugILFrame>();
function.CorILFrame = corFrame;
return function;
} else {
if (corFrame.Is<ICorDebugILFrame>()) {
Function function = new Function(this, chainIndex, frameIndex, corFrame.CastTo<ICorDebugILFrame>());
if (!chainCache.ContainsKey(chainIndex)) chainCache[chainIndex] = new Chain();
chainCache[chainIndex].Frames[frameIndex] = function;
function.Expired += delegate { chainCache[chainIndex].Frames.Remove(frameIndex); };
return function;
} else {
return null;
}
Function function = new Function(this, chainIndex, frameIndex, corFrame.CastTo<ICorDebugILFrame>());
if (!chainCache.ContainsKey(chainIndex)) chainCache[chainIndex] = new Chain();
chainCache[chainIndex].Frames[frameIndex] = function;
function.Expired += delegate { chainCache[chainIndex].Frames.Remove(frameIndex); };
return function;
}
} catch (COMException) { // TODO
return null;

Loading…
Cancel
Save