public static bool Start() { if (DebuggerService.CurrentDebugger == null || DebuggerService.CurrentDebugger.IsDebugging) { return(false); } if (DebuggerSettings.Instance.AskForArguments) { bool?result; var debugOpts = SavedDebuggedOptions.ShowDebugExecutableDialogBox(null, out result); if (result == true) { MainWindow.Instance.OpenFiles(new[] { debugOpts.Executable }, false); DebuggerPlugin.StartExecutable(debugOpts.Executable, debugOpts.WorkingDirectory, debugOpts.Arguments, debugOpts.BreakAtBeginning); return(true); } } else { OpenFileDialog dialog = new OpenFileDialog() { Filter = ".NET Executable (*.exe) | *.exe", RestoreDirectory = true, DefaultExt = "exe" }; if (dialog.ShowDialog() == true) { MainWindow.Instance.OpenFiles(new[] { dialog.FileName }, false); DebuggerPlugin.StartExecutable(dialog.FileName, null, null, DebuggerSettings.Instance.BreakAtBeginning); return(true); } } return(false); }
public static bool Start(string filename) { var debugger = DebuggerService.CurrentDebugger; if (debugger == null || debugger.IsDebugging) { return(false); } if (DebuggerSettings.Instance.AskForArguments) { bool?result; var debugOpts = SavedDebuggedOptions.ShowDebugExecutableDialogBox(filename, out result); if (result == true) { DebuggerPlugin.StartExecutable(debugOpts.Executable, debugOpts.WorkingDirectory, debugOpts.Arguments, debugOpts.BreakAtBeginning); return(true); } return(false); } else { DebuggerPlugin.StartExecutable(filename, null, null, DebuggerSettings.Instance.BreakAtBeginning); return(true); } }
public void Execute(ContextMenuEntryContext context) { var loadedAsm = GetAssembly(context); if (loadedAsm != null) { DebuggerPlugin.Start(loadedAsm.FileName); } }
public void Execute(TextViewContext context) { if (context.SelectedTreeNodes == null) { return; } AssemblyTreeNode n = context.SelectedTreeNodes[0] as AssemblyTreeNode; DebuggerPlugin.Start(n.LoadedAssembly.FileName); }
public static bool Restart() { if (!RestartCanExecute()) { return(false); } if (!Stop()) { return(false); } var inst = SavedDebuggedOptions.Instance; MainWindow.Instance.OpenFiles(new[] { inst.Executable }, false); DebuggerPlugin.StartExecutable(inst.Executable, inst.WorkingDirectory, inst.Arguments, inst.BreakAtBeginning); return(true); }
public static bool Attach() { if (DebuggerService.CurrentDebugger == null || DebuggerService.CurrentDebugger.IsDebugging) { return(false); } MainWindow.Instance.ShowIgnorableMessageBox("debug: attach warning", "Warning: When attaching to an application, some local variables might not be available. If possible, use the \"Debug an Executable\" command.", MessageBoxButton.OK); var window = new AttachToProcessWindow { Owner = MainWindow.Instance }; if (window.ShowDialog() == true) { DebuggerPlugin.StartAttaching(window.SelectedProcess); return(true); } return(false); }
public override void Execute(object parameter) { DebuggerPlugin.DebugShowNextStatement(); }
public void Execute(TextViewContext context) { DebuggerPlugin.DebugEnableDisableBreakpoint(); }
public bool IsVisible(TextViewContext context) { return((context == null || context.TextView != null) && DebuggerPlugin.DebugEnableDisableBreakpointCanExecute()); }
public void Execute(ContextMenuEntryContext context) { DebuggerPlugin.DebugEnableDisableBreakpoint(); }
public void Execute(TextViewContext context) { DebuggerPlugin.DebugToggleBreakpoint(); }
public bool IsVisible(ContextMenuEntryContext context) { return((context == null || context.Element is DecompilerTextView) && DebuggerPlugin.DebugCanSetNextStatement()); }
public void Execute(TextViewContext context) { DebuggerPlugin.DebugSetNextStatement(); }
public override void Execute(object parameter) { DebuggerPlugin.DebugStepInto(); }
public override void Execute(object parameter) { DebuggerPlugin.Detach(); }
public override void Execute(object parameter) { DebuggerPlugin.Restart(); }
protected override bool CanExecuteInternal() { return(base.CanExecuteInternal() && DebuggerPlugin.RestartCanExecute()); }
public override void Execute(object parameter) { DebuggerPlugin.DebugContinue(); }
public bool IsVisible(TextViewContext context) { return((context == null || context.TextView != null) && DebuggerPlugin.DebugShowNextStatementCanExecute()); }
public bool IsVisible(ContextMenuEntryContext context) { return((context == null || context.Element is DecompilerTextView) && DebuggerPlugin.DebugEnableDisableBreakpointCanExecute()); }
public bool IsVisible(TextViewContext context) { return((context == null || context.TextView != null) && DebuggerPlugin.DebugCanSetNextStatement()); }
public override void Execute(object parameter) { DebuggerPlugin.DebugToggleBreakpoint(); }
public override void Execute(object parameter) { DebuggerPlugin.DebugDeleteAllBreakpoints(); }
public void Execute(ContextMenuEntryContext context) { DebuggerPlugin.DebugSetNextStatement(); }
void OnKeyDown(object sender, KeyEventArgs e) { var debugger = DebuggerService.CurrentDebugger; bool debugging = debugger != null && debugger.IsDebugging; if (debugging && Keyboard.Modifiers == ModifierKeys.Shift && e.Key == Key.F5) { Stop(); e.Handled = true; return; } if (debugging && Keyboard.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift) && e.Key == Key.F5) { if (RestartCanExecute()) { Restart(); } e.Handled = true; return; } if (Keyboard.Modifiers == ModifierKeys.None && e.Key == Key.F9) { DebugToggleBreakpoint(); e.Handled = true; return; } if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.F9) { if (DebugEnableDisableBreakpointCanExecute()) { DebugEnableDisableBreakpoint(); } e.Handled = true; return; } if (Keyboard.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift) && e.Key == Key.F9) { if (DebugDeleteAllBreakpointsCanExecute()) { DebugDeleteAllBreakpoints(); } e.Handled = true; return; } if (debugging && Keyboard.Modifiers == ModifierKeys.None && (e.SystemKey == Key.F10 ? e.SystemKey : e.Key) == Key.F10) { DebugStepOver(); e.Handled = true; return; } if (debugging && Keyboard.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift) && (e.SystemKey == Key.F10 ? e.SystemKey : e.Key) == Key.F10) { if (DebugCanSetNextStatement()) { DebugSetNextStatement(); } else { // Show the error message SourceCodeMapping mapping; string errMsg; if (!DebugGetSourceCodeMappingForSetNextStatement(out errMsg, out mapping)) { MainWindow.Instance.ShowMessageBox(errMsg); } } e.Handled = true; return; } if (debugging && Keyboard.Modifiers == ModifierKeys.None && e.Key == Key.F11) { DebugStepInto(); e.Handled = true; return; } if (debugging && Keyboard.Modifiers == ModifierKeys.Shift && e.Key == Key.F11) { DebugStepOut(); e.Handled = true; return; } if (debugging && Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.Cancel) { DebugBreak(); e.Handled = true; return; } if (Keyboard.Modifiers == (ModifierKeys.Control | ModifierKeys.Alt) && e.Key == Key.P) { DebuggerPlugin.Attach(); e.Handled = true; return; } if (debugging && Keyboard.Modifiers == ModifierKeys.Alt && e.SystemKey == Key.Multiply) { if (DebugShowNextStatementCanExecute()) { DebugShowNextStatement(); } e.Handled = true; return; } }
protected override bool CanExecuteInternal() { return(base.CanExecuteInternal() && DebuggerPlugin.DebugDeleteAllBreakpointsCanExecute()); }