Esempio n. 1
0
        public void JumpToCurrentLine()
        {
            if (debuggedProcess != null && debuggedProcess.SelectedThread != null)
            {
                MainWindow.Instance.Activate();

                // use most recent stack frame because we don't have the symbols
                var frame = debuggedProcess.SelectedThread.MostRecentStackFrame;

                if (frame == null)
                {
                    return;
                }

                int             token    = frame.MethodInfo.MetadataToken;
                int             ilOffset = frame.IP;
                int             line;
                MemberReference memberReference;

                if (DebugInformation.CodeMappings != null &&
                    DebugInformation.CodeMappings.ContainsKey(token) &&
                    DebugInformation.CodeMappings[token].GetInstructionByTokenAndOffset(ilOffset, out memberReference, out line))
                {
                    DebugInformation.DebugStepInformation = null;                     // we do not need to step into/out
                    DebuggerService.RemoveCurrentLineMarker();
                    DebuggerService.JumpToCurrentLine(memberReference, line, 0, line, 0, ilOffset);
                }
                else
                {
                    StepIntoUnknownFrame(frame);
                }
            }
        }
Esempio n. 2
0
 void debuggedProcess_DebuggingResumed(object sender, CorDbg.ProcessEventArgs e)
 {
     OnIsProcessRunningChanged(EventArgs.Empty);
     DebuggerService.RemoveCurrentLineMarker();
 }