void View_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (debuggedProcess == null) { return; } if (debuggedProcess.IsPaused) { CallStackItem item = view.SelectedItem as CallStackItem; if (item == null) { return; } if (item.Frame != null && debuggedProcess.SelectedThread != null) { // check for options - if these options are enabled, selecting the frame should not continue if (!item.Frame.HasSymbols && !debuggedProcess.Options.DecompileCodeWithoutSymbols) { MessageService.ShowMessage("${res:MainWindow.Windows.Debug.CallStack.CannotSwitchWithoutSymbolsOrDecompiledCodeOptions}", "${res:MainWindow.Windows.Debug.CallStack.FunctionSwitch}"); return; } debuggedProcess.SelectedThread.SelectedStackFrame = item.Frame; debuggedProcess.PauseSession.PausedReason = PausedReason.CurrentFunctionChanged; debuggedProcess.OnPaused(); // Force refresh of pads - artificial pause } } else { MessageService.ShowMessage("${res:MainWindow.Windows.Debug.CallStack.CannotSwitchWhileRunning}", "${res:MainWindow.Windows.Debug.CallStack.FunctionSwitch}"); } }
void View_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { if (debuggedProcess == null) { return; } if (debuggedProcess.IsPaused) { CallStackItem item = view.SelectedItem as CallStackItem; if (item == null) { return; } if (item.Frame.HasSymbols) { if (debuggedProcess.SelectedThread != null) { debuggedProcess.SelectedThread.SelectedStackFrame = item.Frame; debuggedProcess.OnPaused(); // Force refresh of pads } } else { MessageService.ShowMessage("${res:MainWindow.Windows.Debug.CallStack.CannotSwitchWithoutSymbols}", "${res:MainWindow.Windows.Debug.CallStack.FunctionSwitch}"); } } else { MessageService.ShowMessage("${res:MainWindow.Windows.Debug.CallStack.CannotSwitchWhileRunning}", "${res:MainWindow.Windows.Debug.CallStack.FunctionSwitch}"); } }
IEnumerable <CallStackItem> CreateItems() { bool showExternalMethods = DebuggingOptions.Instance.ShowExternalMethods; bool lastItemIsExternalMethod = false; foreach (StackFrame frame in debuggedProcess.SelectedThread.GetCallstack(100)) { CallStackItem item; // line number string lineNumber = string.Empty; if (DebuggingOptions.Instance.ShowLineNumbers) { if (frame.NextStatement != null) { lineNumber = frame.NextStatement.StartLine.ToString(); } } // show modules names string moduleName = string.Empty; if (DebuggingOptions.Instance.ShowModuleNames) { moduleName = frame.MethodInfo.DebugModule.ToString(); } if (frame.HasSymbols || showExternalMethods) { // Show the method in the list item = new CallStackItem() { Name = GetFullName(frame), Language = "", Line = lineNumber, ModuleName = moduleName }; lastItemIsExternalMethod = false; } else { // Show [External methods] in the list if (lastItemIsExternalMethod) { continue; } item = new CallStackItem() { Name = ResourceService.GetString("MainWindow.Windows.Debug.CallStack.ExternalMethods"), Language = "" }; lastItemIsExternalMethod = true; } item.Frame = frame; yield return(item); Utils.DoEvents(debuggedProcess); } }
CallStackItem CreateItem(StackFrame frame, bool showExternalMethods, ref bool previousItemIsExternalMethod) { CallStackItem item; // line number string lineNumber = string.Empty; if (DebuggingOptions.Instance.ShowLineNumbers) { if (frame.NextStatement != null) { lineNumber = frame.NextStatement.StartLine.ToString(); } } // show modules names string moduleName = string.Empty; if (DebuggingOptions.Instance.ShowModuleNames) { moduleName = frame.MethodInfo.DebugModule.ToString(); } if (frame.HasSymbols || showExternalMethods) { // Show the method in the list item = new CallStackItem() { Name = GetFullName(frame), Language = "", Line = lineNumber, ModuleName = moduleName }; previousItemIsExternalMethod = false; item.Frame = frame; } else { // Show [External methods] in the list if (previousItemIsExternalMethod) { return(null); } item = new CallStackItem() { Name = ResourceService.GetString("MainWindow.Windows.Debug.CallStack.ExternalMethods"), Language = "" }; previousItemIsExternalMethod = true; } return(item); }
void listView_MouseDoubleClick(object sender, MouseButtonEventArgs e) { CallStackItem item = listView.SelectedItem as CallStackItem; if ((item == null) || (item.Frame == null)) { return; } if (item.Frame.Process.IsPaused) { if (item.Frame != null) { WindowsDebugger.CurrentStackFrame = item.Frame; WindowsDebugger.Instance.JumpToCurrentLine(); WindowsDebugger.RefreshPads(); } } else { MessageService.ShowMessage("${res:MainWindow.Windows.Debug.CallStack.CannotSwitchWhileRunning}", "${res:MainWindow.Windows.Debug.CallStack.FunctionSwitch}"); } }
IEnumerable<CallStackItem> CreateItems() { bool showExternalMethods = DebuggingOptions.Instance.ShowExternalMethods; bool lastItemIsExternalMethod = false; foreach (StackFrame frame in debuggedProcess.SelectedThread.GetCallstack(100)) { CallStackItem item; // line number string lineNumber = string.Empty; if (DebuggingOptions.Instance.ShowLineNumbers) { if (frame.NextStatement != null) lineNumber = frame.NextStatement.StartLine.ToString(); } // show modules names string moduleName = string.Empty; if (DebuggingOptions.Instance.ShowModuleNames) { moduleName = frame.MethodInfo.DebugModule.ToString(); } if (frame.HasSymbols || showExternalMethods) { // Show the method in the list item = new CallStackItem() { Name = GetFullName(frame), Language = "", Line = lineNumber, ModuleName = moduleName }; lastItemIsExternalMethod = false; } else { // Show [External methods] in the list if (lastItemIsExternalMethod) continue; item = new CallStackItem() { Name = ResourceService.GetString("MainWindow.Windows.Debug.CallStack.ExternalMethods"), Language = "" }; lastItemIsExternalMethod = true; } item.Frame = frame; yield return item; Utils.DoEvents(debuggedProcess); } }
IEnumerable<CallStackItem> CreateItems() { bool showExternalMethods = DebuggingOptions.Instance.ShowExternalMethods; bool lastItemIsExternalMethod = false; foreach (StackFrame frame in debuggedProcess.SelectedThread.GetCallstack(100)) { CallStackItem item; if (frame.HasSymbols || showExternalMethods) { // Show the method in the list item = new CallStackItem() { Name = GetFullName(frame), Language = "" }; lastItemIsExternalMethod = false; } else { // Show [External methods] in the list if (lastItemIsExternalMethod) continue; item = new CallStackItem() { Name = ResourceService.GetString("MainWindow.Windows.Debug.CallStack.ExternalMethods"), Language = "" }; lastItemIsExternalMethod = true; } item.Frame = frame; yield return item; Utils.DoEvents(debuggedProcess); } }
CallStackItem CreateItem(StackFrame frame, bool showExternalMethods, ref bool previousItemIsExternalMethod) { CallStackItem item; // line number string lineNumber = string.Empty; if (DebuggingOptions.Instance.ShowLineNumbers) { if (frame.NextStatement != null) lineNumber = frame.NextStatement.StartLine.ToString(); } // show modules names string moduleName = string.Empty; if (DebuggingOptions.Instance.ShowModuleNames) { moduleName = frame.MethodInfo.DebugModule.ToString(); } if (frame.HasSymbols || showExternalMethods) { // Show the method in the list item = new CallStackItem() { Name = GetFullName(frame), Language = "", Line = lineNumber, ModuleName = moduleName }; previousItemIsExternalMethod = false; item.Frame = frame; } else { // Show [External methods] in the list if (previousItemIsExternalMethod) return null; item = new CallStackItem() { Name = ResourceService.GetString("MainWindow.Windows.Debug.CallStack.ExternalMethods"), Language = "" }; previousItemIsExternalMethod = true; } return item; }