Browse Source

Debugger handles optimized code more gracefully

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@890 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 20 years ago
parent
commit
cdc0d7362e
  1. 14
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Threads/Function.cs
  2. 13
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs
  3. 6
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/NDebugger-Evals.cs

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

@ -455,7 +455,12 @@ namespace Debugger @@ -455,7 +455,12 @@ namespace Debugger
if (this.HasExpired) {
return new UnavailableValue(debugger, "Function has expired");
} else {
return Value.CreateValue(debugger, GetArgumentValue(index));
try {
return Value.CreateValue(debugger, GetArgumentValue(index));
} catch (COMException e) {
if ((uint)e.ErrorCode == 0x80131304) return new UnavailableValue(debugger, "Unavailable in optimized code");
throw;
}
}
});
}
@ -502,7 +507,12 @@ namespace Debugger @@ -502,7 +507,12 @@ namespace Debugger
return new UnavailableValue(debugger, "Function has expired");
} else {
ICorDebugValue corValue;
CorILFrame.GetLocalVariable((uint)symVar.AddressField1, out corValue);
try {
CorILFrame.GetLocalVariable((uint)symVar.AddressField1, out corValue);
} catch (COMException e) {
if ((uint)e.ErrorCode == 0x80131304) return new UnavailableValue(debugger, "Unavailable in optimized code");
throw;
}
return Value.CreateValue(debugger, corValue);
}
});

13
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Variables/Evals/Eval.cs

@ -124,7 +124,18 @@ namespace Debugger @@ -124,7 +124,18 @@ namespace Debugger
// TODO: What if this thread is not suitable?
targetThread.CorThread.CreateEval(out corEval);
corEval.CallFunction(corFunction, (uint)args.Length, args);
try {
corEval.CallFunction(corFunction, (uint)args.Length, args);
} catch (COMException e) {
if ((uint)e.ErrorCode == 0x80131C26) {
error = "Can not evaluate in optimized code";
evalState = EvalState.Error;
if (EvalComplete != null) {
EvalComplete(this, new EvalEventArgs(this));
}
return false;
}
}
OnEvalStarted(new EvalEventArgs(this));

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

@ -83,7 +83,11 @@ namespace Debugger @@ -83,7 +83,11 @@ namespace Debugger
internal bool SetupNextEvaluation(Thread targetThread)
{
if (pendingEvalsCollection.Count > 0) {
return pendingEvalsCollection[0].SetupEvaluation(targetThread);
if (pendingEvalsCollection[0].SetupEvaluation(targetThread)) {
return true;
} else {
return SetupNextEvaluation(targetThread);
}
} else {
return false;
}

Loading…
Cancel
Save