protected override void RefreshProcessList(ListView listView, bool showNonManaged) { listView.Items.Clear(); WindowsDebugger debugger = (WindowsDebugger)DebuggerService.CurrentDebugger; Process currentProcess = Process.GetCurrentProcess(); foreach (Process process in Process.GetProcesses()) { try { if (process.HasExited) { continue; } // Prevent attaching to our own process. if (currentProcess.Id != process.Id) { ProcessListViewItem item = new ProcessListViewItem(process, debugger); if (showNonManaged || item.IsManaged) { item.Tag = process; listView.Items.Add(item); } } } catch (Win32Exception) { // Do nothing. } } listView.Sort(); }
public override void Run() { ITextEditorProvider provider = WorkbenchSingleton.Workbench.ActiveViewContent as ITextEditorProvider; WindowsDebugger winDebugger = DebuggerService.CurrentDebugger as WindowsDebugger; if (provider == null || winDebugger == null) { return; } ITextEditor textEditor = provider.TextEditor; Breakpoint breakpoint = winDebugger.DebuggerCore.Breakpoints.Add(textEditor.FileName, null, textEditor.Caret.Line, textEditor.Caret.Column, true); // Be careful to remove the breakpoint just once breakpoint.Hit += delegate { if (breakpoint != null) { breakpoint.Remove(); } breakpoint = null; }; winDebugger.DebuggedProcess.Paused += delegate { if (breakpoint != null) { breakpoint.Remove(); } breakpoint = null; }; if (!winDebugger.IsProcessRunning) { winDebugger.Continue(); } }
private ObjectGraphWindow() { InitializeComponent(); debuggerService = SD.Debugger as WindowsDebugger; if (debuggerService == null) throw new DebuggerVisualizerException("Only windows debugger is currently supported"); }
public ObjectGraphWindow() { InitializeComponent(); debuggerService = DebuggerService.CurrentDebugger as WindowsDebugger; if (debuggerService == null) throw new ApplicationException("Only windows debugger is currently supported"); registerEvents(); instance = this; }
public DebuggerPad() { debugger = (WindowsDebugger)DebuggerService.CurrentDebugger; InitializeComponents(); debugger.ProcessSelected += delegate(object sender, ProcessEventArgs e) { SelectProcess(e.Process); }; SelectProcess(debugger.DebuggedProcess); }
public GridVisualizerWindow() { InitializeComponent(); this.debuggerService = DebuggerService.CurrentDebugger as WindowsDebugger; if (debuggerService == null) throw new ApplicationException("Only windows debugger is currently supported"); instance = this; this.Deactivated += GridVisualizerWindow_Deactivated; }
void InitializeComponents() { debugger = (WindowsDebugger)DebuggerService.CurrentDebugger; if (debugger.ServiceInitialized) { InitializeDebugger(); } else { debugger.Initialize += delegate { InitializeDebugger(); }; } }
public override bool SetInstructionPointer(string filename, int line, int column, bool dryRun) { if (CurrentStackFrame != null) { if (CurrentStackFrame.SetIP(filename, line, column, dryRun)) { WindowsDebugger.RefreshPads(); JumpToCurrentLine(); } } return(false); }
public ProcessListViewItem(Process process, WindowsDebugger debugger) { this.process = process; try { managed = debugger.IsManaged(process.Id); } catch { } string fileName = Path.GetFileName(process.MainModule.FileName); Text = fileName; SubItems.Add(process.Id.ToString()); SubItems.Add(process.MainWindowTitle); SubItems.Add(GetManagedString(managed)); }
public ObjectGraphControl() { InitializeComponent(); debuggerService = DebuggerService.CurrentDebugger as WindowsDebugger; if (debuggerService == null) throw new ApplicationException("Only windows debugger is currently supported"); this.layoutViewModel = new EnumViewModel<LayoutDirection>(); this.layoutViewModel.PropertyChanged += new PropertyChangedEventHandler(layoutViewModel_PropertyChanged); this.cmbLayoutDirection.DataContext = this.layoutViewModel; this.graphDrawer = new GraphDrawer(this.canvas); }
public ProcessListViewItem(Process process, WindowsDebugger debugger) { this.process = process; try { managed = process.Modules .OfType<ProcessModule>() .Any(m => m.ModuleName.StartsWith("mscor", StringComparison.InvariantCultureIgnoreCase)); } catch { } string fileName = Path.GetFileName(process.MainModule.FileName); Text = fileName; SubItems.Add(process.Id.ToString()); SubItems.Add(process.MainWindowTitle); SubItems.Add(GetManagedString(managed)); }
public ProcessListViewItem(Process process, WindowsDebugger debugger) { this.process = process; try { managed = process.Modules .OfType <ProcessModule>() .Any(m => m.ModuleName.StartsWith("mscor", StringComparison.InvariantCultureIgnoreCase)); } catch { } string fileName = Path.GetFileName(process.MainModule.FileName); Text = fileName; SubItems.Add(process.Id.ToString()); SubItems.Add(process.MainWindowTitle); SubItems.Add(GetManagedString(managed)); }
public override void Run() { SharpDevelopTextAreaControl textEditor = this.Owner as SharpDevelopTextAreaControl; WindowsDebugger winDebugger = DebuggerService.CurrentDebugger as WindowsDebugger; if (textEditor == null || winDebugger == null) { return; } Breakpoint breakpoint = winDebugger.DebuggerCore.AddBreakpoint(textEditor.FileName, null, textEditor.ActiveTextAreaControl.Caret.Line + 1, textEditor.ActiveTextAreaControl.Caret.Column, true); breakpoint.Hit += delegate { breakpoint.Remove(); }; winDebugger.DebuggedProcess.Paused += delegate { breakpoint.Remove(); }; if (!winDebugger.IsProcessRunning) { winDebugger.Continue(); } }
public DebuggerPad() { // UI this.panel = new DockPanel(); this.toolbar = BuildToolBar(); if (this.toolbar != null) { this.toolbar.SetValue(DockPanel.DockProperty, Dock.Top); this.panel.Children.Add(toolbar); } // logic debugger = (WindowsDebugger)DebuggerService.CurrentDebugger; InitializeComponents(); debugger.ProcessSelected += delegate(object sender, ProcessEventArgs e) { SelectProcess(e.Process); }; SelectProcess(debugger.DebuggedProcess); }
public PinDebuggerControl() { InitializeComponent(); if (!DebuggerService.IsDebuggerStarted) Opacity = MINIMUM_OPACITY; this.PinCloseControl.Opacity = 0; Loaded += OnLoaded; this.PinCloseControl.Closed += PinCloseControl_Closed; this.PinCloseControl.ShowingComment += PinCloseControl_ShowingComment; this.PinCloseControl.PinningChanged += PinCloseControl_PinningChanged; BookmarkManager.Removed += OnBookmarkRemoved; currentDebugger = (WindowsDebugger)DebuggerService.CurrentDebugger; currentDebugger.DebugStopped += OnDebugStopped; currentDebugger.ProcessSelected += OnProcessSelected; if (currentDebugger.DebuggedProcess != null) currentDebugger.DebuggedProcess.Paused += OnDebuggedProcessPaused; }
/// <summary> /// Creates ObjectGraphBuilder. /// </summary> /// <param name="debuggerService">Debugger service.</param> public ObjectGraphBuilder(WindowsDebugger debuggerService) { this.debuggerService = debuggerService; }
public void Close() { CloseChildPopups(); Unpin(); BookmarkManager.Removed -= OnBookmarkRemoved; if (currentDebugger != null) { currentDebugger.DebugStopped -= OnDebugStopped; currentDebugger.ProcessSelected -= OnProcessSelected; currentDebugger = null; } }