/// <summary> /// Open the source code at the current location. /// </summary> public void JumpToCurrentLine() { DebuggerService.RemoveCurrentLineMarker(); var process = CurrentProcess; if (process == null) { return; } // Activate the main window WorkbenchSingleton.MainWindow.Activate(); // Get the current frame var frame = CurrentStackFrame; if (frame == null) { return; } // Get the document location var location = frame.GetDocumentLocationAsync().Await(DalvikProcess.VmTimeout); if (location != null && location.SourceCode != null) { DebuggerService.RemoveCurrentLineMarker(); var p = location.SourceCode.Position; #if DEBUG Debug.WriteLine(string.Format("Current location: ({0},{1})-({2},{3}) {4:X4}", p.Start.Line, p.Start.Column, p.End.Line, p.End.Column, frame.Location.Index)); #endif DebuggerService.JumpToCurrentLine(location.SourceCode.Document.Path, p.Start.Line, p.Start.Column, p.End.Line, p.End.Column); } }
public void JumpToCurrentLine() { DebuggerService.RemoveCurrentLineMarker(); if (debuggedProcess != null) { SourcecodeSegment nextStatement = debuggedProcess.NextStatement; if (nextStatement != null) { DebuggerService.JumpToCurrentLine(nextStatement.Filename, nextStatement.StartLine, nextStatement.StartColumn, nextStatement.EndLine, nextStatement.EndColumn); } } }
public void JumpToCurrentLine() { WorkbenchSingleton.MainForm.Activate(); DebuggerService.RemoveCurrentLineMarker(); if (debuggedProcess != null) { SourcecodeSegment nextStatement = debuggedProcess.NextStatement; if (nextStatement != null) { string fileName = GetFileName(nextStatement); DebuggerService.JumpToCurrentLine(fileName, nextStatement.StartLine, nextStatement.StartColumn, nextStatement.EndLine, nextStatement.EndColumn); } } }
void JumpToSourceCode() { if (debuggedProcess == null || debuggedProcess.SelectedThread == null) { return; } SourcecodeSegment nextStatement = debuggedProcess.NextStatement; if (nextStatement != null) { DebuggerService.RemoveCurrentLineMarker(); DebuggerService.JumpToCurrentLine(nextStatement.Filename, nextStatement.StartLine, nextStatement.StartColumn, nextStatement.EndLine, nextStatement.EndColumn); } }
void UpdateDebugUI(bool isDecompilationOk) { // sync bookmarks iconMargin.SyncBookmarks(); if (isDecompilationOk) { if (DebugInformation.DebugStepInformation != null && DebuggerService.CurrentDebugger != null) { // repaint bookmarks iconMargin.InvalidateVisual(); // show the currentline marker int token = DebugInformation.DebugStepInformation.Item1; int ilOffset = DebugInformation.DebugStepInformation.Item2; int line; MemberReference member; if (DebugInformation.CodeMappings == null || !DebugInformation.CodeMappings.ContainsKey(token)) { return; } if (!DebugInformation.CodeMappings[token].GetInstructionByTokenAndOffset(ilOffset, out member, out line)) { return; } // update marker DebuggerService.JumpToCurrentLine(member, line, 0, line, 0, ilOffset); var bm = CurrentLineBookmark.Instance; DocumentLine docline = textEditor.Document.GetLineByNumber(line); bm.Marker = bm.CreateMarker(textMarkerService, docline.Offset + 1, docline.Length); UnfoldAndScroll(line); } } else { // remove currentline marker CurrentLineBookmark.Remove(); } }
void SyncCurrentLineBookmark() { // checks if (CurrentLineBookmark.Instance == null) { return; } var codeMappings = DebugInformation.CodeMappings; if (codeMappings == null) { return; } // 1. Save it's data int line = CurrentLineBookmark.Instance.LineNumber; var markerType = CurrentLineBookmark.Instance.MemberReference; int token = markerType.MetadataToken.ToInt32(); int offset = CurrentLineBookmark.Instance.ILOffset; if (!codeMappings.ContainsKey(token)) { return; } // 2. map the marker line MemberReference memberReference; int newline; if (codeMappings[token].GetInstructionByTokenAndOffset(offset, out memberReference, out newline)) { // 3. create breakpoint for new languages DebuggerService.JumpToCurrentLine(memberReference, newline, 0, newline, 0, offset); } }