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

Loading…
Cancel
Save