示例#1
0
        /// <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);
            }
        }
示例#2
0
 /// <summary>
 /// Fire the IsProcessRunningChanged event.
 /// This method must be called on the main thread.
 /// </summary>
 private void OnDebugProcessIsSuspendedChangedOnMainThread(bool isProcessRunning)
 {
     this.IsProcessRunningChanged.Fire(this);
     if (isProcessRunning)
     {
         DebuggerService.RemoveCurrentLineMarker();
     }
     else
     {
         JumpToCurrentLine();
     }
 }
示例#3
0
 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);
         }
     }
 }
示例#4
0
 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 JumpToDecompiledCode(Debugger.StackFrame frame)
        {
            if (frame == null)
            {
                LoggingService.Error("No stack frame!");
                return;
            }

            if (debuggerDecompilerService == null)
            {
                LoggingService.Warn("No IDebuggerDecompilerService found!");
                return;
            }

            // check for options - if these options are enabled, debugging decompiled code should not continue
            if (!debuggedProcess.Options.DecompileCodeWithoutSymbols)
            {
                LoggingService.Info("Decompiled code debugging is disabled!");
                return;
            }
            DebuggerService.RemoveCurrentLineMarker();
            // get external data
            int typeToken   = frame.MethodInfo.DeclaringType.MetadataToken;
            int methodToken = frame.MethodInfo.MetadataToken;
            int ilOffset    = frame.IP;

            int[] ilRanges  = null;
            int   line      = -1;
            bool  isMatch   = false;
            var   debugType = (DebugType)frame.MethodInfo.DeclaringType;

            debuggerDecompilerService.DebugStepInformation = Tuple.Create(methodToken, ilOffset);

            if (debuggerDecompilerService.GetILAndLineNumber(typeToken, methodToken, ilOffset, out ilRanges, out line, out isMatch))
            {
                // update marker & navigate to line
                NavigationService.NavigateTo(debugType.DebugModule.FullPath,
                                             debugType.FullNameWithoutGenericArguments,
                                             IDStringProvider.GetIDString(frame.MethodInfo),
                                             line);
            }
            else
            {
                // no line => do decompilation
                NavigationService.NavigateTo(debugType.DebugModule.FullPath,
                                             debugType.FullNameWithoutGenericArguments,
                                             IDStringProvider.GetIDString(frame.MethodInfo));
            }
        }
        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);
            }
        }
示例#7
0
 private void debuggedProcess_DebuggingResumed(object sender, ProcessEventArgs e)
 {
     OnIsProcessRunningChanged(EventArgs.Empty);
     DebuggerService.RemoveCurrentLineMarker();
 }