public async Task WhenStoreModifiedExternallyThenIteratingOverBreakpointsShouldNotThrow() { var store = new BreakpointStore(); Action <int> threadAddAction = (x) => { store.Add(new Breakpoint($"fileName{x}.cs", 10)); }; Action threadEnumerateAction = () => { foreach (var bk in store.GetBreakpointsAtFile("fileName1.cs")) { } }; List <Task> tasks = new List <Task> (); for (int i = 0; i < 10; i++) { tasks.Add(Task.Run(() => { threadAddAction(i); })); tasks.Add(Task.Run(() => { threadEnumerateAction(); })); } foreach (var task in tasks) { await task; } }
internal void SetAllLiveUpdateBreakpoints(BreakpointStore bps) { lock (watches) { foreach (PinnedWatch w in watches) { if (w.LiveUpdate) { var bp = CreateLiveUpdateBreakpoint(w); Bind(w, bp); bps.Add(bp); } } } }
public DebugManager2() { Breakpoints = new BreakpointStore(); Breakpoints.BreakpointAdded += (sender, e) => { SaveBreakpoints(); }; Breakpoints.BreakpointRemoved += (sender, e) => { SaveBreakpoints(); }; }
internal void BindAll(BreakpointStore bps) { lock (watches) { foreach (PinnedWatch w in watches) { foreach (Breakpoint bp in bps.GetBreakpoints()) { if (bp.HitAction == HitAction.PrintExpression && bp.TraceExpression == "{" + w.Expression + "}" && bp.FileName == w.File && bp.Line == w.Line) { Bind(w, bp); } } } } }
internal void BindAll(BreakpointStore bps) { lock (watches) { foreach (var watch in watches) { foreach (var bp in bps.GetBreakpoints()) { if ((bp.HitAction & HitAction.PrintExpression) != HitAction.None && bp.TraceExpression == "{" + watch.Expression + "}" && bp.FileName == watch.File && bp.Line == watch.Line) { Bind(watch, bp); } } } } }
public static void ResetState() { // No need to lock on this data. WorkingDirectory = Environment.CurrentDirectory; Arguments = string.Empty; EnvironmentVariables = new SortedDictionary <string, string>(); Watches = new SortedDictionary <long, string>(); _nextWatchId = 0; Breakpoints = new SortedDictionary <long, BreakEvent>(); Aliases = new SortedDictionary <string, string>(StringComparer.InvariantCultureIgnoreCase); BreakEvents = new BreakpointStore(); // Make sure breakpoints/catchpoints take effect. lock (_lock) if (_session != null) { _session.Breakpoints = BreakEvents; } }
public void GetBreakpointsAtFileReturnsCorrectFiles() { var store = new BreakpointStore(); store.Add(new Breakpoint("fileName1.cs", 10)); store.Add(new Breakpoint("fileName1.cs", 20)); store.Add(new Breakpoint("fileName2.cs", 10)); store.Add(new Breakpoint("fileName3.cs", 15)); int count = 0; foreach (var bk in store.GetBreakpointsAtFile("fileName1.cs")) { count++; Assert.AreEqual("fileName1.cs", bk.FileName); } Assert.AreEqual(2, count); }
public SoftDebugger(MonoEngine engine) { _debugEngine = engine; _options = new DebuggerSessionOptions() { EvaluationOptions = EvaluationOptions.DefaultOptions }; _options.EvaluationOptions.UseExternalTypeResolver = true; _session = new SoftDebuggerSession(); _session.Breakpoints = (_breakEvents = new BreakpointStore()); _session.TypeResolverHandler += event_TypeResolverHandler; _session.TargetReady += event_TargetReady; _session.TargetExited += event_TargetExited; _session.TargetThreadStarted += event_TargetThreadStarted; _session.TargetThreadStopped += event_TargetThreadStopped; _session.TargetHitBreakpoint += event_TargetHitBreakpoint; _session.TargetUnhandledException += event_TargetUnhandledException; }
public void Initialize(IPadWindow window) { // Toolbar and menu definitions ActionCommand gotoCmd = new ActionCommand(LocalCommands.GoToFile, GettextCatalog.GetString("Go to File")); ActionCommand propertiesCmd = new ActionCommand(LocalCommands.Properties, GettextCatalog.GetString("Properties"), Gtk.Stock.Properties); menuSet = new CommandEntrySet(); menuSet.Add(gotoCmd); menuSet.AddSeparator(); menuSet.AddItem(DebugCommands.EnableDisableBreakpoint); menuSet.AddItem(DebugCommands.ClearAllBreakpoints); menuSet.AddItem(DebugCommands.DisableAllBreakpoints); menuSet.AddItem(EditCommands.DeleteKey); menuSet.AddSeparator(); menuSet.Add(propertiesCmd); CommandEntrySet toolbarSet = new CommandEntrySet(); toolbarSet.AddItem(DebugCommands.EnableDisableBreakpoint); toolbarSet.AddItem(DebugCommands.ClearAllBreakpoints); toolbarSet.AddItem(DebugCommands.DisableAllBreakpoints); toolbarSet.AddItem(EditCommands.Delete); toolbarSet.AddSeparator(); toolbarSet.Add(propertiesCmd); // The breakpoint list store = new TreeStore(typeof(string), typeof(bool), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string), typeof(string)); tree = new PadTreeView(); tree.Model = store; tree.RulesHint = true; tree.HeadersVisible = true; tree.DoPopupMenu = ShowPopup; tree.KeyPressEvent += OnKeyPressEvent; treeState = new TreeViewState(tree, (int)Columns.Breakpoint); TreeViewColumn col = new TreeViewColumn(); CellRenderer crp = new CellRendererIcon(); col.PackStart(crp, false); col.AddAttribute(crp, "stock_id", (int)Columns.Icon); tree.AppendColumn(col); Gtk.CellRendererToggle toggleRender = new Gtk.CellRendererToggle(); toggleRender.Toggled += new ToggledHandler(ItemToggled); col = new TreeViewColumn(); col.PackStart(toggleRender, false); col.AddAttribute(toggleRender, "active", (int)Columns.Selected); tree.AppendColumn(col); TreeViewColumn FrameCol = new TreeViewColumn(); CellRenderer crt = tree.TextRenderer; FrameCol.Title = GettextCatalog.GetString("Name"); FrameCol.PackStart(crt, true); FrameCol.AddAttribute(crt, "text", (int)Columns.FileName); FrameCol.Resizable = true; FrameCol.Alignment = 0.0f; tree.AppendColumn(FrameCol); col = tree.AppendColumn(GettextCatalog.GetString("Condition"), crt, "text", (int)Columns.Condition); col.Resizable = true; col = tree.AppendColumn(GettextCatalog.GetString("Trace Expression"), crt, "text", (int)Columns.TraceExp); col.Resizable = true; col = tree.AppendColumn(GettextCatalog.GetString("Hit Count"), crt, "text", (int)Columns.HitCount); col.Resizable = true; col = tree.AppendColumn(GettextCatalog.GetString("Last Trace"), crt, "text", (int)Columns.LastTrace); col.Resizable = true; sw = new Gtk.ScrolledWindow(); sw.ShadowType = ShadowType.None; sw.Add(tree); control = sw; control.ShowAll(); bps = DebuggingService.Breakpoints; UpdateDisplay(); breakpointUpdatedHandler = DispatchService.GuiDispatch <EventHandler <BreakpointEventArgs> > (OnBreakpointUpdated); breakpointRemovedHandler = DispatchService.GuiDispatch <EventHandler <BreakpointEventArgs> > (OnBreakpointRemoved); breakpointAddedHandler = DispatchService.GuiDispatch <EventHandler <BreakpointEventArgs> > (OnBreakpointAdded); breakpointChangedHandler = DispatchService.GuiDispatch <EventHandler> (OnBreakpointChanged); DebuggingService.Breakpoints.BreakpointAdded += breakpointAddedHandler; DebuggingService.Breakpoints.BreakpointRemoved += breakpointRemovedHandler; DebuggingService.Breakpoints.Changed += breakpointChangedHandler; DebuggingService.Breakpoints.BreakpointUpdated += breakpointUpdatedHandler; DebuggingService.PausedEvent += OnDebuggerStatusCheck; DebuggingService.ResumedEvent += OnDebuggerStatusCheck; DebuggingService.StoppedEvent += OnDebuggerStatusCheck; tree.RowActivated += OnRowActivated; DockItemToolbar toolbar = window.GetToolbar(PositionType.Top); toolbar.Add(toolbarSet, sw); toolbar.ShowAll(); }
public void Initialize (IPadWindow window) { // Toolbar and menu definitions ActionCommand gotoCmd = new ActionCommand (LocalCommands.GoToFile, GettextCatalog.GetString ("Go to File")); ActionCommand propertiesCmd = new ActionCommand (LocalCommands.Properties, GettextCatalog.GetString ("Properties"), Gtk.Stock.Properties); menuSet = new CommandEntrySet (); menuSet.Add (gotoCmd); menuSet.AddSeparator (); menuSet.AddItem (DebugCommands.EnableDisableBreakpoint); menuSet.AddItem (DebugCommands.ClearAllBreakpoints); menuSet.AddItem (DebugCommands.DisableAllBreakpoints); menuSet.AddItem (EditCommands.DeleteKey); menuSet.AddSeparator (); menuSet.Add (propertiesCmd); CommandEntrySet toolbarSet = new CommandEntrySet (); toolbarSet.AddItem (DebugCommands.EnableDisableBreakpoint); toolbarSet.AddItem (DebugCommands.ClearAllBreakpoints); toolbarSet.AddItem (DebugCommands.DisableAllBreakpoints); toolbarSet.AddItem (EditCommands.Delete); toolbarSet.AddSeparator (); toolbarSet.Add (propertiesCmd); // The breakpoint list store = new TreeStore (typeof(string), typeof (bool), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string), typeof(string)); tree = new PadTreeView (); tree.Model = store; tree.RulesHint = true; tree.HeadersVisible = true; tree.DoPopupMenu = ShowPopup; tree.KeyPressEvent += OnKeyPressEvent; treeState = new TreeViewState (tree, (int) Columns.Breakpoint); TreeViewColumn col = new TreeViewColumn (); CellRenderer crp = new CellRendererIcon (); col.PackStart (crp, false); col.AddAttribute (crp, "stock_id", (int) Columns.Icon); tree.AppendColumn (col); Gtk.CellRendererToggle toggleRender = new Gtk.CellRendererToggle (); toggleRender.Toggled += new ToggledHandler (ItemToggled); col = new TreeViewColumn (); col.PackStart (toggleRender, false); col.AddAttribute (toggleRender, "active", (int) Columns.Selected); tree.AppendColumn (col); TreeViewColumn FrameCol = new TreeViewColumn (); CellRenderer crt = tree.TextRenderer; FrameCol.Title = GettextCatalog.GetString ("Name"); FrameCol.PackStart (crt, true); FrameCol.AddAttribute (crt, "text", (int) Columns.FileName); FrameCol.Resizable = true; FrameCol.Alignment = 0.0f; tree.AppendColumn (FrameCol); col = tree.AppendColumn (GettextCatalog.GetString ("Condition"), crt, "text", (int) Columns.Condition); col.Resizable = true; col = tree.AppendColumn (GettextCatalog.GetString ("Trace Expression"), crt, "text", (int) Columns.TraceExp); col.Resizable = true; col = tree.AppendColumn (GettextCatalog.GetString ("Hit Count"), crt, "text", (int) Columns.HitCount); col.Resizable = true; col = tree.AppendColumn (GettextCatalog.GetString ("Last Trace"), crt, "text", (int) Columns.LastTrace); col.Resizable = true; sw = new Gtk.ScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (tree); control = sw; control.ShowAll (); bps = DebuggingService.Breakpoints; UpdateDisplay (); breakpointUpdatedHandler = DispatchService.GuiDispatch<EventHandler<BreakpointEventArgs>> (OnBreakpointUpdated); breakpointRemovedHandler = DispatchService.GuiDispatch<EventHandler<BreakpointEventArgs>> (OnBreakpointRemoved); breakpointAddedHandler = DispatchService.GuiDispatch<EventHandler<BreakpointEventArgs>> (OnBreakpointAdded); breakpointChangedHandler = DispatchService.GuiDispatch<EventHandler> (OnBreakpointChanged); DebuggingService.Breakpoints.BreakpointAdded += breakpointAddedHandler; DebuggingService.Breakpoints.BreakpointRemoved += breakpointRemovedHandler; DebuggingService.Breakpoints.Changed += breakpointChangedHandler; DebuggingService.Breakpoints.BreakpointUpdated += breakpointUpdatedHandler; DebuggingService.PausedEvent += OnDebuggerStatusCheck; DebuggingService.ResumedEvent += OnDebuggerStatusCheck; DebuggingService.StoppedEvent += OnDebuggerStatusCheck; tree.RowActivated += OnRowActivated; DockItemToolbar toolbar = window.GetToolbar (PositionType.Top); toolbar.Add (toolbarSet, sw); toolbar.ShowAll (); }
public static void ResetState() { // No need to lock on this data. WorkingDirectory = Environment.CurrentDirectory; Arguments = string.Empty; EnvironmentVariables = new SortedDictionary<string, string>(); Watches = new SortedDictionary<long, string>(); _nextWatchId = 0; Breakpoints = new SortedDictionary<long, BreakEvent>(); Aliases = new SortedDictionary<string, string>(StringComparer.InvariantCultureIgnoreCase); BreakEvents = new BreakpointStore(); // Make sure breakpoints/catchpoints take effect. lock (_lock) if (_session != null) _session.Breakpoints = BreakEvents; }
public BreakPointMargin(CodeEditor editor, BreakpointStore manager) { _manager = manager; _editor = editor; }
public void Dispose() { _manager = null; _editor = null; }
public SourceEditorView (IReadonlyTextDocument document = null) { Counters.LoadedEditors++; widget = new SourceEditorWidget (this); if (document != null) { var textDocument = document as TextDocument; if (textDocument != null) { widget.TextEditor.Document = textDocument; } else { widget.TextEditor.Document.Text = document.Text; } } widget.TextEditor.Document.TextReplaced += HandleTextReplaced; widget.TextEditor.Document.LineChanged += HandleLineChanged; widget.TextEditor.Document.LineInserted += HandleLineChanged; widget.TextEditor.Document.LineRemoved += HandleLineChanged; widget.TextEditor.Document.BeginUndo += HandleBeginUndo; widget.TextEditor.Document.EndUndo += HandleEndUndo; widget.TextEditor.Document.TextReplacing += OnTextReplacing; widget.TextEditor.Document.TextReplaced += OnTextReplaced; widget.TextEditor.Document.ReadOnlyCheckDelegate = CheckReadOnly; widget.TextEditor.TextViewMargin.LineShown += TextViewMargin_LineShown; // widget.TextEditor.Document.DocumentUpdated += delegate { // this.IsDirty = Document.IsDirty; // }; widget.TextEditor.Caret.PositionChanged += HandlePositionChanged; widget.TextEditor.IconMargin.ButtonPressed += OnIconButtonPress; ClipbardRingUpdated += UpdateClipboardRing; TextEditorService.FileExtensionAdded += HandleFileExtensionAdded; TextEditorService.FileExtensionRemoved += HandleFileExtensionRemoved; breakpoints = DebuggingService.Breakpoints; DebuggingService.DebugSessionStarted += OnDebugSessionStarted; DebuggingService.StoppedEvent += HandleTargetExited; DebuggingService.ExecutionLocationChanged += OnExecutionLocationChanged; DebuggingService.CurrentFrameChanged += OnCurrentFrameChanged; DebuggingService.StoppedEvent += OnCurrentFrameChanged; DebuggingService.ResumedEvent += OnCurrentFrameChanged; breakpoints.BreakpointAdded += OnBreakpointAdded; breakpoints.BreakpointRemoved += OnBreakpointRemoved; breakpoints.BreakpointStatusChanged += OnBreakpointStatusChanged; breakpoints.BreakpointModified += OnBreakpointStatusChanged; DebuggingService.PinnedWatches.WatchAdded += OnWatchAdded; DebuggingService.PinnedWatches.WatchRemoved += OnWatchRemoved; DebuggingService.PinnedWatches.WatchChanged += OnWatchChanged; TaskService.Errors.TasksAdded += UpdateTasks; TaskService.Errors.TasksRemoved += UpdateTasks; TaskService.JumpedToTask += HandleTaskServiceJumpedToTask; IdeApp.Preferences.ShowMessageBubbles.Changed += HandleIdeAppPreferencesShowMessageBubblesChanged; TaskService.TaskToggled += HandleErrorListPadTaskToggled; widget.TextEditor.Options.Changed += HandleWidgetTextEditorOptionsChanged; IdeApp.Preferences.DefaultHideMessageBubbles.Changed += HandleIdeAppPreferencesDefaultHideMessageBubblesChanged; Document.AddAnnotation (this); if (document != null) { Document.MimeType = document.MimeType; Document.FileName = document.FileName; } FileRegistry.Add (this); }
public SourceEditorView () { Counters.LoadedEditors++; currentFrameChanged = (EventHandler)DispatchService.GuiDispatch (new EventHandler (OnCurrentFrameChanged)); breakpointAdded = (EventHandler<BreakpointEventArgs>)DispatchService.GuiDispatch (new EventHandler<BreakpointEventArgs> (OnBreakpointAdded)); breakpointRemoved = (EventHandler<BreakpointEventArgs>)DispatchService.GuiDispatch (new EventHandler<BreakpointEventArgs> (OnBreakpointRemoved)); breakpointStatusChanged = (EventHandler<BreakpointEventArgs>)DispatchService.GuiDispatch (new EventHandler<BreakpointEventArgs> (OnBreakpointStatusChanged)); widget = new SourceEditorWidget (this); widget.TextEditor.Document.SyntaxModeChanged += HandleSyntaxModeChanged; widget.TextEditor.Document.TextReplaced += HandleTextReplaced; widget.TextEditor.Document.LineChanged += HandleLineChanged; widget.TextEditor.Document.BeginUndo += HandleBeginUndo; widget.TextEditor.Document.EndUndo += HandleEndUndo; widget.TextEditor.Document.Undone += HandleUndone; widget.TextEditor.Document.Redone += HandleUndone; widget.TextEditor.Document.TextReplacing += OnTextReplacing; widget.TextEditor.Document.TextReplaced += OnTextReplaced; widget.TextEditor.Document.ReadOnlyCheckDelegate = CheckReadOnly; // widget.TextEditor.Document.DocumentUpdated += delegate { // this.IsDirty = Document.IsDirty; // }; widget.TextEditor.Caret.PositionChanged += HandlePositionChanged; widget.TextEditor.IconMargin.ButtonPressed += OnIconButtonPress; debugStackLineMarker = new DebugStackLineTextMarker (widget.TextEditor); currentDebugLineMarker = new CurrentDebugLineTextMarker (widget.TextEditor); this.WorkbenchWindowChanged += HandleWorkbenchWindowChanged; this.ContentNameChanged += delegate { this.Document.FileName = this.ContentName; if (String.IsNullOrEmpty (ContentName) || !File.Exists (ContentName)) return; lastSaveTimeUtc = File.GetLastWriteTimeUtc (ContentName); }; ClipbardRingUpdated += UpdateClipboardRing; TextEditorService.FileExtensionAdded += HandleFileExtensionAdded; TextEditorService.FileExtensionRemoved += HandleFileExtensionRemoved; breakpoints = DebuggingService.Breakpoints; DebuggingService.DebugSessionStarted += OnDebugSessionStarted; DebuggingService.CurrentFrameChanged += currentFrameChanged; DebuggingService.StoppedEvent += currentFrameChanged; DebuggingService.ResumedEvent += currentFrameChanged; breakpoints.BreakpointAdded += breakpointAdded; breakpoints.BreakpointRemoved += breakpointRemoved; breakpoints.BreakpointStatusChanged += breakpointStatusChanged; breakpoints.BreakpointModified += breakpointStatusChanged; DebuggingService.PinnedWatches.WatchAdded += OnWatchAdded; DebuggingService.PinnedWatches.WatchRemoved += OnWatchRemoved; DebuggingService.PinnedWatches.WatchChanged += OnWatchChanged; TaskService.Errors.TasksAdded += UpdateTasks; TaskService.Errors.TasksRemoved += UpdateTasks; TaskService.JumpedToTask += HandleTaskServiceJumpedToTask; IdeApp.Preferences.ShowMessageBubblesChanged += HandleIdeAppPreferencesShowMessageBubblesChanged; TaskService.TaskToggled += HandleErrorListPadTaskToggled; widget.TextEditor.Options.Changed += HandleWidgetTextEditorOptionsChanged; IdeApp.Preferences.DefaultHideMessageBubblesChanged += HandleIdeAppPreferencesDefaultHideMessageBubblesChanged; Document.AddAnnotation (this); FileRegistry.Add (this); }
protected override void Initialize (IPadWindow window) { Id = "MonoDevelop.Debugger.BreakpointPad"; // Toolbar and menu definitions ActionCommand gotoCmd = new ActionCommand (LocalCommands.GoToFile, GettextCatalog.GetString ("Go to File")); ActionCommand propertiesCmd = new ActionCommand (LocalCommands.Properties, GettextCatalog.GetString ("Edit Breakpoint…"), Stock.Properties); menuSet = new CommandEntrySet (); menuSet.Add (propertiesCmd); menuSet.Add (gotoCmd); menuSet.AddSeparator (); menuSet.AddItem (DebugCommands.EnableDisableBreakpoint); menuSet.AddItem (DebugCommands.DisableAllBreakpoints); menuSet.AddSeparator (); menuSet.AddItem (EditCommands.DeleteKey); menuSet.AddItem (DebugCommands.ClearAllBreakpoints); CommandEntrySet toolbarSet = new CommandEntrySet (); toolbarSet.AddItem (DebugCommands.EnableDisableBreakpoint); toolbarSet.AddItem (DebugCommands.ClearAllBreakpoints); toolbarSet.AddItem (DebugCommands.DisableAllBreakpoints); toolbarSet.AddItem (EditCommands.Delete); toolbarSet.AddSeparator (); toolbarSet.Add (propertiesCmd); toolbarSet.AddSeparator (); toolbarSet.Add (new CommandEntry (DebugCommands.NewFunctionBreakpoint){ DisplayType = CommandEntryDisplayType.IconAndText }); toolbarSet.Add (new CommandEntry (DebugCommands.NewCatchpoint){ DisplayType = CommandEntryDisplayType.IconAndText }); // The breakpoint list store = new TreeStore (typeof(string), typeof (bool), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string), typeof(string)); SemanticModelAttribute modelAttr = new SemanticModelAttribute ("store__Icon", "store__Selected","store_FileName", "store_Breakpoint", "store_Condition", "store_TraceExp", "store_HitCount", "store_LastTrace"); TypeDescriptor.AddAttributes (store, modelAttr); tree = new PadTreeView (); tree.Model = store; tree.RulesHint = true; tree.HeadersVisible = true; tree.DoPopupMenu = ShowPopup; tree.KeyPressEvent += OnKeyPressEvent; tree.Selection.Mode = SelectionMode.Multiple; treeState = new TreeViewState (tree, (int) Columns.Breakpoint); TreeViewColumn col = new TreeViewColumn (); CellRenderer crp = new CellRendererImage (); col.PackStart (crp, false); col.AddAttribute (crp, "stock_id", (int) Columns.Icon); tree.AppendColumn (col); Gtk.CellRendererToggle toggleRender = new Gtk.CellRendererToggle (); toggleRender.Toggled += new ToggledHandler (ItemToggled); col = new TreeViewColumn (); col.PackStart (toggleRender, false); col.AddAttribute (toggleRender, "active", (int) Columns.Selected); tree.AppendColumn (col); TreeViewColumn FrameCol = new TreeViewColumn (); CellRenderer crt = tree.TextRenderer; FrameCol.Title = GettextCatalog.GetString ("Name"); FrameCol.PackStart (crt, true); FrameCol.AddAttribute (crt, "text", (int) Columns.FileName); FrameCol.Resizable = true; FrameCol.Alignment = 0.0f; tree.AppendColumn (FrameCol); col = tree.AppendColumn (GettextCatalog.GetString ("Condition"), crt, "text", (int) Columns.Condition); col.Resizable = true; col = tree.AppendColumn (GettextCatalog.GetString ("Trace Expression"), crt, "text", (int) Columns.TraceExp); col.Resizable = true; col = tree.AppendColumn (GettextCatalog.GetString ("Hit Count"), crt, "text", (int) Columns.HitCount); col.Resizable = true; col = tree.AppendColumn (GettextCatalog.GetString ("Last Trace"), crt, "text", (int) Columns.LastTrace); col.Resizable = true; sw = new Gtk.ScrolledWindow (); sw.ShadowType = ShadowType.None; sw.Add (tree); control = sw; control.ShowAll (); breakpoints = DebuggingService.Breakpoints; UpdateDisplay (); breakpoints.BreakpointAdded += OnBreakpointAdded; breakpoints.BreakpointRemoved += OnBreakpointRemoved; breakpoints.Changed += OnBreakpointChanged; breakpoints.BreakpointUpdated += OnBreakpointUpdated; DebuggingService.PausedEvent += OnDebuggerStatusCheck; DebuggingService.ResumedEvent += OnDebuggerStatusCheck; DebuggingService.StoppedEvent += OnDebuggerStatusCheck; tree.RowActivated += OnRowActivated; DockItemToolbar toolbar = window.GetToolbar (DockPositionType.Top); toolbar.Add (toolbarSet, sw); toolbar.ShowAll (); }
public BreakPointMargin(CodeEditor editor, BreakpointStore manager) { _manager = manager ?? throw new ArgumentNullException(nameof(manager)); _editor = editor ?? throw new ArgumentNullException(nameof(editor)); }
protected override void Initialize(IPadWindow window) { Id = "MonoDevelop.Debugger.BreakpointPad"; // Toolbar and menu definitions ActionCommand gotoCmd = new ActionCommand(LocalCommands.GoToFile, GettextCatalog.GetString("Go to File")); ActionCommand propertiesCmd = new ActionCommand(LocalCommands.Properties, GettextCatalog.GetString("Edit Breakpoint…"), Stock.Properties); menuSet = new CommandEntrySet(); menuSet.Add(propertiesCmd); menuSet.Add(gotoCmd); menuSet.AddSeparator(); menuSet.AddItem(DebugCommands.EnableDisableBreakpoint); menuSet.AddItem(DebugCommands.DisableAllBreakpoints); menuSet.AddSeparator(); menuSet.AddItem(EditCommands.DeleteKey); menuSet.AddItem(DebugCommands.ClearAllBreakpoints); CommandEntrySet toolbarSet = new CommandEntrySet(); toolbarSet.AddItem(DebugCommands.EnableDisableBreakpoint); toolbarSet.AddItem(DebugCommands.ClearAllBreakpoints); toolbarSet.AddItem(DebugCommands.DisableAllBreakpoints); toolbarSet.AddItem(EditCommands.Delete); toolbarSet.AddSeparator(); toolbarSet.Add(propertiesCmd); toolbarSet.AddSeparator(); toolbarSet.Add(new CommandEntry(DebugCommands.NewFunctionBreakpoint) { DisplayType = CommandEntryDisplayType.IconAndText }); toolbarSet.Add(new CommandEntry(DebugCommands.NewCatchpoint) { DisplayType = CommandEntryDisplayType.IconAndText }); // The breakpoint list store = new TreeStore(typeof(string), typeof(bool), typeof(string), typeof(object), typeof(string), typeof(string), typeof(string), typeof(string)); SemanticModelAttribute modelAttr = new SemanticModelAttribute("store__Icon", "store__Selected", "store_FileName", "store_Breakpoint", "store_Condition", "store_TraceExp", "store_HitCount", "store_LastTrace"); TypeDescriptor.AddAttributes(store, modelAttr); tree = new PadTreeView(); tree.Model = store; tree.RulesHint = true; tree.HeadersVisible = true; tree.DoPopupMenu = ShowPopup; tree.KeyPressEvent += OnKeyPressEvent; tree.Selection.Mode = SelectionMode.Multiple; treeState = new TreeViewState(tree, (int)Columns.Breakpoint); TreeViewColumn col = new TreeViewColumn(); CellRenderer crp = new CellRendererImage(); col.PackStart(crp, false); col.AddAttribute(crp, "stock_id", (int)Columns.Icon); tree.AppendColumn(col); Gtk.CellRendererToggle toggleRender = new Gtk.CellRendererToggle(); toggleRender.Toggled += new ToggledHandler(ItemToggled); col = new TreeViewColumn(); col.PackStart(toggleRender, false); col.AddAttribute(toggleRender, "active", (int)Columns.Selected); tree.AppendColumn(col); TreeViewColumn FrameCol = new TreeViewColumn(); CellRenderer crt = tree.TextRenderer; FrameCol.Title = GettextCatalog.GetString("Name"); FrameCol.PackStart(crt, true); FrameCol.AddAttribute(crt, "text", (int)Columns.FileName); FrameCol.Resizable = true; FrameCol.Alignment = 0.0f; tree.AppendColumn(FrameCol); col = tree.AppendColumn(GettextCatalog.GetString("Condition"), crt, "text", (int)Columns.Condition); col.Resizable = true; col = tree.AppendColumn(GettextCatalog.GetString("Trace Expression"), crt, "text", (int)Columns.TraceExp); col.Resizable = true; col = tree.AppendColumn(GettextCatalog.GetString("Hit Count"), crt, "text", (int)Columns.HitCount); col.Resizable = true; col = tree.AppendColumn(GettextCatalog.GetString("Last Trace"), crt, "text", (int)Columns.LastTrace); col.Resizable = true; sw = new Gtk.ScrolledWindow(); sw.ShadowType = ShadowType.None; sw.Add(tree); control = sw; control.ShowAll(); breakpoints = DebuggingService.Breakpoints; UpdateDisplay(); breakpoints.BreakpointAdded += OnBreakpointAdded; breakpoints.BreakpointRemoved += OnBreakpointRemoved; breakpoints.Changed += OnBreakpointChanged; breakpoints.BreakpointUpdated += OnBreakpointUpdated; DebuggingService.PausedEvent += OnDebuggerStatusCheck; DebuggingService.ResumedEvent += OnDebuggerStatusCheck; DebuggingService.StoppedEvent += OnDebuggerStatusCheck; tree.RowActivated += OnRowActivated; DockItemToolbar toolbar = window.GetToolbar(DockPositionType.Top); toolbar.Add(toolbarSet, sw); toolbar.ShowAll(); }
internal void BindAll (BreakpointStore bps) { lock (watches) { foreach (PinnedWatch w in watches) { foreach (Breakpoint bp in bps.GetBreakpoints ()) { if ((bp.HitAction & HitAction.PrintExpression) != HitAction.None && bp.TraceExpression == "{" + w.Expression + "}" && bp.FileName == w.File && bp.Line == w.Line) Bind (w, bp); } } } }