Browse Source

fix issue when codemappings are not entirely built.

pull/16/head
Eusebiu Marcu 14 years ago
parent
commit
73442ef67b
  1. 5
      src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs
  2. 18
      src/Main/Base/Project/Src/Services/Debugger/CurrentLineBookmark.cs

5
src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs

@ -233,6 +233,11 @@ namespace ICSharpCode.ILSpyAddIn
debugInformation.CodeMappings[token].GetInstructionByTokenAndOffset(token, ilOffset, out member, out line); debugInformation.CodeMappings[token].GetInstructionByTokenAndOffset(token, ilOffset, out member, out line);
// HACK : if the codemappings are not built
if (line == 0) {
DebuggerService.CurrentDebugger.StepOver();
return;
}
// update bookmark & marker // update bookmark & marker
codeView.UnfoldAndScroll(line); codeView.UnfoldAndScroll(line);
CurrentLineBookmark.SetPosition(this, line, 0, line, 0); CurrentLineBookmark.SetPosition(this, line, 0, line, 0);

18
src/Main/Base/Project/Src/Services/Debugger/CurrentLineBookmark.cs

@ -14,6 +14,7 @@ namespace ICSharpCode.SharpDevelop.Debugging
{ {
public class CurrentLineBookmark : SDMarkerBookmark public class CurrentLineBookmark : SDMarkerBookmark
{ {
static object syncObject = new object();
static CurrentLineBookmark instance; static CurrentLineBookmark instance;
static int startLine; static int startLine;
@ -27,14 +28,15 @@ namespace ICSharpCode.SharpDevelop.Debugging
if (tecp != null) { if (tecp != null) {
SetPosition(tecp.TextEditor.FileName, tecp.TextEditor.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn); SetPosition(tecp.TextEditor.FileName, tecp.TextEditor.Document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
} else { } else {
if (makerStartLine == 0) lock (syncObject) {
return; dynamic codeView = viewContent.Control;
var document = codeView.TextEditor.Document as IDocument;
dynamic codeView = viewContent.Control; SetPosition(null, document, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn);
SetPosition(null, codeView.TextEditor.Document as IDocument, makerStartLine, makerStartColumn, makerEndLine, makerEndColumn); codeView.IconBarManager.Bookmarks.Add(CurrentLineBookmark.instance);
codeView.IconBarManager.Bookmarks.Add(CurrentLineBookmark.instance); codeView.UnfoldAndScroll(makerStartLine);
codeView.UnfoldAndScroll(makerStartLine); if (document != null)
CurrentLineBookmark.instance.Document = codeView.TextEditor.Document as IDocument; CurrentLineBookmark.instance.Document = document;
}
} }
} }

Loading…
Cancel
Save