Browse Source

Step out when the mapping is not found.

pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
61d8b4742a
  1. 2
      Debugger/Debugger.Core/Options.cs
  2. 30
      Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs

2
Debugger/Debugger.Core/Options.cs

@ -13,7 +13,7 @@ namespace Debugger @@ -13,7 +13,7 @@ namespace Debugger
public bool StepOverFieldAccessProperties = true;
public bool Verbose = false;
public string[] SymbolsSearchPaths = new string[0];
public bool SuspendOtherThreads = true;
public bool SuspendOtherThreads = false;
public bool EnableEditAndContinue = false;
}
}

30
Debugger/ILSpy.Debugger/Services/Debugger/WindowsDebugger.cs

@ -298,28 +298,6 @@ namespace ILSpy.Debugger.Services @@ -298,28 +298,6 @@ namespace ILSpy.Debugger.Services
((DebugType)frame.MethodInfo.DeclaringType).FullNameWithoutGenericArguments,
(uint)frame.MethodInfo.MetadataToken,
frame.IP, out isMatch);
// int i = debuggedProcess.SelectedThread.Callstack.Count() - 1;
// if (i < 0)
// return null;
//
// while (true) {
// frame = debuggedProcess.SelectedThread.Callstack.ElementAt(i);
//
// // get the mapped instruction from the current line marker or the next one
// var result = CodeMappingsStorage.GetInstructionByTypeTokenAndOffset(
// ((DebugType)frame.MethodInfo.DeclaringType).FullNameWithoutGenericArguments,
// (uint)frame.MethodInfo.MetadataToken,
// frame.IP, out isMatch);
//
// if (result == null) {
// i--;
// if (i < 0)
// return result;
// } else {
// return result;
// }
// }
}
StackFrame GetStackFrame()
@ -328,7 +306,7 @@ namespace ILSpy.Debugger.Services @@ -328,7 +306,7 @@ namespace ILSpy.Debugger.Services
StackFrame frame;
var map = GetCurrentCodeMapping(out frame, out isMatch);
if (map == null) {
return null;
return debuggedProcess.SelectedThread.MostRecentStackFrame;
} else {
//var frame = debuggedProcess.SelectedThread.MostRecentStackFrame;
frame.SourceCodeLine = map.SourceCodeLine;
@ -874,7 +852,6 @@ namespace ILSpy.Debugger.Services @@ -874,7 +852,6 @@ namespace ILSpy.Debugger.Services
nestedTypeDef = localType;
typeDef = localType.DeclaringType;
}
break;
}
}
@ -895,12 +872,11 @@ namespace ILSpy.Debugger.Services @@ -895,12 +872,11 @@ namespace ILSpy.Debugger.Services
DebuggerService.RemoveCurrentLineMarker();
DebuggerService.JumpToCurrentLine(typeDef, line, 0, line, 0);
} else {
// continue since we cannot find the debugged type
throw new InvalidOperationException(string.Format("No mapping for {0} for token {1} and offset {2}!", fullName, token, ilOffset));
StepOut();
}
} else {
// continue since we cannot find the debugged type
throw new NullReferenceException(string.Format("The type {0} was not found!", fullName));
Debug.Assert(typeDef != null, string.Format("The type {0} was not found!", fullName));
}
}
}

Loading…
Cancel
Save