Browse Source

Use the fallback method is evaluation of Exception.StackTrace fails.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3213 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
David Srbecký 18 years ago
parent
commit
18ab7bbb3c
  1. 8
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs
  2. 3
      src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Exception.cs

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

@ -607,7 +607,13 @@ namespace ICSharpCode.SharpDevelop.Services
// Need to intercept now so that we can evaluate properties // Need to intercept now so that we can evaluate properties
if (e.Process.SelectedThread.InterceptCurrentException()) { if (e.Process.SelectedThread.InterceptCurrentException()) {
msg.AppendLine(e.Exception.ToString()); msg.AppendLine(e.Exception.ToString());
msg.Append(e.Exception.GetStackTrace(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.EndOfInnerException}"))); string stackTrace;
try {
stackTrace = e.Exception.GetStackTrace(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.EndOfInnerException}"));
} catch (GetValueException) {
stackTrace = e.Process.SelectedThread.GetStackTrace(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.Symbols}"), StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.LineFormat.NoSymbols}"));
}
msg.Append(stackTrace);
} else { } else {
// For example, happens on stack overflow // For example, happens on stack overflow
msg.AppendLine(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Error.CannotInterceptException}")); msg.AppendLine(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Error.CannotInterceptException}"));

3
src/AddIns/Misc/Debugger/Debugger.Core/Project/Src/Debugger/Exception.cs

@ -79,6 +79,9 @@ namespace Debugger
return GetStackTrace("--- End of inner exception stack trace ---"); return GetStackTrace("--- End of inner exception stack trace ---");
} }
/// <summary> Returs formated stacktrace for the exception </summary>
/// <exception cref="GetValueException"> Getting the stacktrace involves property
/// evaluation so GetValueException can be thrown in some cicumstances. </exception>
public string GetStackTrace(string endOfInnerExceptionFormat) public string GetStackTrace(string endOfInnerExceptionFormat)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();

Loading…
Cancel
Save