diff --git a/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs b/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs index 705cc0b8ab..40cf4f7b4b 100644 --- a/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs +++ b/src/AddIns/DisplayBindings/ILSpyAddIn/ViewContent/DecompiledViewContent.cs @@ -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); diff --git a/src/Main/Base/Project/Src/Services/Debugger/CurrentLineBookmark.cs b/src/Main/Base/Project/Src/Services/Debugger/CurrentLineBookmark.cs index 921c33231d..9a80788f46 100644 --- a/src/Main/Base/Project/Src/Services/Debugger/CurrentLineBookmark.cs +++ b/src/Main/Base/Project/Src/Services/Debugger/CurrentLineBookmark.cs @@ -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 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; + } } }