示例#1
0
 protected override void Run()
 {
     DebuggingService.ShowCurrentExecutionLine();
 }
示例#2
0
 protected override void Update(CommandInfo info)
 {
     info.Visible = DebuggingService.IsFeatureSupported(DebuggerFeatures.Disassembly);
 }
示例#3
0
        protected override void Update(CommandInfo info)
        {
            info.Visible = true;

            if (!IdeApp.Workspace.IsOpen || !DebuggingService.IsDebuggingSupported || !DebuggingService.IsFeatureSupported(DebuggerFeatures.Breakpoints) || DebuggingService.Breakpoints.IsReadOnly)
            {
                info.Enabled = false;
                return;
            }

            var doc = IdeApp.Workbench.ActiveDocument;

            if (doc?.Editor != null && doc.FileName != FilePath.Null)
            {
                var target = DebugHandler.GetRunTarget();
                if (target != null && IdeApp.ProjectOperations.CanDebug(target))
                {
                    info.Enabled = true;
                    return;
                }
            }
            info.Enabled = false;
        }
示例#4
0
 protected override void Run()
 {
     DebuggingService.Pause();
 }
示例#5
0
 protected override void Run()
 {
     DebuggingService.Resume();
 }
        DebuggerTypeProxyAttribute GetDebuggerTypeProxyAttribute(DebuggingService dbgr, ITargetObject obj)
        {
            if (obj.TypeInfo.Type.TypeHandle != null && obj.TypeInfo.Type.TypeHandle is Type)
                return dbgr.AttributeHandler.GetDebuggerTypeProxyAttribute ((Type)obj.TypeInfo.Type.TypeHandle);

            return null;
        }
示例#7
0
        void UpdateSelectedException(ExceptionInfo ex)
        {
            selected = ex;
            var  model    = (ListStore)StackTraceTreeView.Model;
            bool external = false;

            model.Clear();
            var parentException = ex;

            while (parentException != null)
            {
                foreach (var frame in parentException.StackTrace)
                {
                    bool isUserCode = IsUserCode(frame);

                    if (OnlyShowMyCodeCheckbox.Active && !isUserCode)
                    {
                        if (!external)
                        {
                            var str = "<b>" + GettextCatalog.GetString("[External Code]") + "</b>";
                            model.AppendValues(null, str, false);
                            external = true;
                        }

                        continue;
                    }

                    model.AppendValues(frame, null, isUserCode);
                    external = false;
                }
                if (!ReverseInnerExceptions.TryGetValue(parentException, out parentException))
                {
                    parentException = null;
                }
            }
            ExceptionValueTreeView.ClearAll();
            if (!ex.IsEvaluating && ex.Instance != null)
            {
                var opts = DebuggingService.GetUserOptions().EvaluationOptions.Clone();
                opts.FlattenHierarchy = true;
                ExceptionValueTreeView.AddValues(ex.Instance.GetAllChildren(opts));
            }

            if (ex.StackIsEvaluating)
            {
                var str = GettextCatalog.GetString("Loading...");
                model.AppendValues(null, str, false);
            }

            if (InnerExceptionTypeLabel != null)
            {
                InnerExceptionTypeLabel.Markup  = "<b>" + GLib.Markup.EscapeText(ex.Type) + "</b>";
                InnerExceptionMessageLabel.Text = ex.Message;
                if (!string.IsNullOrEmpty(ex.HelpLink))
                {
                    InnerExceptionHelpLinkButton.Label = GettextCatalog.GetString("Read More…");
                    innerExceptionHelpLink             = ex.HelpLink;
                    InnerExceptionHelpLinkButton.Show();
                }
                else
                {
                    innerExceptionHelpLink = string.Empty;
                    InnerExceptionHelpLinkButton.Hide();
                }
            }
        }
示例#8
0
 protected override void Run()
 {
     DebuggingService.ShowAddTracepointDialog(
         IdeApp.Workbench.ActiveDocument.FileName,
         IdeApp.Workbench.ActiveDocument.Editor.Caret.Line);
 }
示例#9
0
 protected override void Update(CommandInfo info)
 {
     info.Visible = DebuggingService.IsFeatureSupported(DebuggerFeatures.Breakpoints);
     info.Enabled = !DebuggingService.Breakpoints.IsReadOnly && IdeApp.Workspace.IsOpen;
 }
 public BreakpointEntry(DebuggingService service, string file, int line)
 {
     this.service = service;
     this.file = file;
     this.line = line;
 }
示例#11
0
 public ProcessAsyncOperation Execute(ExecutionCommand command, OperationConsole console)
 {
     return(DebuggingService.Run(command, console, engine));
 }
		public DebugExecutionHandler (DebuggingService service)
		{
			this.service = service;
			service.StoppedEvent += new EventHandler (OnStopDebug);
		}
		public DebugExecutionHandlerFactory (DebuggingService service)
		{
			this.service = service;
		}
示例#14
0
        DebuggerVisualizerAttribute[] GetDebuggerVisualizerAttributes(DebuggingService dbgr, ITargetObject obj)
        {
            if (obj.TypeInfo.Type.TypeHandle != null && obj.TypeInfo.Type.TypeHandle is Type)
              return dbgr.AttributeHandler.GetDebuggerVisualizerAttributes ((Type)obj.TypeInfo.Type.TypeHandle);

            return null;
        }
示例#15
0
 protected override void Update(CommandInfo info)
 {
     info.Enabled = IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted;
     info.Visible = DebuggingService.IsFeatureSupported(DebuggerFeatures.Attaching);
 }
示例#16
0
 protected override void Run()
 {
     DebuggingService.ShowExceptionsFilters();
 }
示例#17
0
 protected override void Update(CommandInfo info)
 {
     info.Enabled = DebuggingService.IsPaused;
     info.Visible = DebuggingService.IsFeatureSupported(DebuggerFeatures.Stepping);
 }
示例#18
0
 protected override void Update(CommandInfo info)
 {
     info.Visible = DebuggingService.IsFeatureSupported(DebuggerFeatures.Catchpoints);
 }
示例#19
0
        void Build()
        {
            Title         = GettextCatalog.GetString("Exception Caught");
            DefaultWidth  = 500;
            DefaultHeight = 500;
            HeightRequest = 350;
            WidthRequest  = 350;
            VBox.Foreach(VBox.Remove);
            VBox.PackStart(CreateExceptionHeader(), false, true, 0);
            paned = new VPanedThin();
            paned.GrabAreaSize = 10;
            paned.Pack1(CreateStackTraceTreeView(), true, false);
            paned.Pack2(CreateExceptionValueTreeView(), true, false);
            paned.Show();
            var vbox            = new VBox(false, 0);
            var whiteBackground = new EventBox();

            whiteBackground.Show();
            whiteBackground.ModifyBg(StateType.Normal, Ide.Gui.Styles.PrimaryBackgroundColor.ToGdkColor());
            whiteBackground.Add(vbox);
            hadInnerException = HasInnerException();
            if (hadInnerException)
            {
                vbox.PackStart(new VBox(), false, false, 6);
                vbox.PackStart(CreateInnerExceptionMessage(), false, true, 0);
                vbox.ShowAll();
            }
            vbox.PackStart(paned, true, true, 0);
            vbox.Show();

            if (hadInnerException)
            {
                var box = new HBox();
                box.PackStart(CreateInnerExceptionsTree(), false, false, 0);
                box.PackStart(whiteBackground, true, true, 0);
                box.Show();
                VBox.PackStart(box, true, true, 0);
                DefaultWidth  = 900;
                DefaultHeight = 700;
                WidthRequest  = 550;
                HeightRequest = 450;
            }
            else
            {
                VBox.PackStart(whiteBackground, true, true, 0);
            }
            var actionArea = new HBox(false, 0)
            {
                BorderWidth = 14
            };

            OnlyShowMyCodeCheckbox          = new CheckButton(GettextCatalog.GetString("_Only show my code"));
            OnlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled;
            OnlyShowMyCodeCheckbox.Show();
            OnlyShowMyCodeCheckbox.Active = DebuggingService.GetUserOptions().ProjectAssembliesOnly;

            var alignment = new Alignment(0.0f, 0.5f, 0.0f, 0.0f)
            {
                Child = OnlyShowMyCodeCheckbox
            };

            alignment.Show();

            actionArea.PackStart(alignment, true, true, 0);
            actionArea.PackStart(CreateButtonBox(), false, true, 0);
            actionArea.PackStart(new VBox(), false, true, 3);               // dummy just to take extra 6px at end to make it 20pixels
            actionArea.ShowAll();

            VBox.PackStart(actionArea, false, true, 0);
        }
示例#20
0
        protected override void Run()
        {
            if (DebuggingService.IsPaused)
            {
                DebuggingService.Resume();
                return;
            }

            if (!DebuggingService.IsDebuggingSupported && !IdeApp.ProjectOperations.CurrentRunOperation.IsCompleted)
            {
                MonoDevelop.Ide.Commands.StopHandler.StopBuildOperations();
                IdeApp.ProjectOperations.CurrentRunOperation.WaitForCompleted();
            }

            if (!IdeApp.Preferences.BuildBeforeExecuting)
            {
                if (IdeApp.Workspace.IsOpen)
                {
                    var         it = GetRunTarget();
                    CheckResult cr = CheckBeforeDebugging(it);
                    if (cr == DebugHandler.CheckResult.Cancel)
                    {
                        return;
                    }
                    if (cr == DebugHandler.CheckResult.Run)
                    {
                        ExecuteSolution(it);
                        return;
                    }
                    // Else continue building
                }
                else
                {
                    ExecuteDocument(IdeApp.Workbench.ActiveDocument);
                    return;
                }
            }

            if (IdeApp.Workspace.IsOpen)
            {
                var             it = GetRunTarget();
                IAsyncOperation op = IdeApp.ProjectOperations.Build(it);
                op.Completed += delegate {
                    if (op.SuccessWithWarnings && !IdeApp.Preferences.RunWithWarnings)
                    {
                        return;
                    }
                    if (op.Success)
                    {
                        ExecuteSolution(it);
                    }
                };
            }
            else
            {
                Document doc = IdeApp.Workbench.ActiveDocument;
                if (doc != null)
                {
                    doc.Save();
                    IAsyncOperation op = doc.Build();
                    op.Completed += delegate {
                        if (op.SuccessWithWarnings && !IdeApp.Preferences.RunWithWarnings)
                        {
                            return;
                        }
                        if (op.Success)
                        {
                            ExecuteDocument(doc);
                        }
                    };
                }
            }
        }
示例#21
0
 protected override void Update(CommandInfo info)
 {
     info.Enabled = info.Visible = DebuggingService.IsFeatureSupported(DebuggerFeatures.Attaching);
 }
示例#22
0
        public static AsyncOperation Debug(this ProjectOperations opers, IBuildTarget entry, bool buildBeforeExecuting = true)
        {
            ExecutionContext context = new ExecutionContext(DebuggingService.GetExecutionHandler(), IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget);

            return(opers.Execute(entry, context, buildBeforeExecuting));
        }
示例#23
0
 protected override void Update(CommandInfo info)
 {
     info.Visible = DebuggingService.IsRunning;
     info.Enabled = DebuggingService.IsFeatureSupported(DebuggerFeatures.Pause) && DebuggingService.IsConnected;
 }
示例#24
0
        public static AsyncOperation DebugFile(this ProjectOperations opers, string file)
        {
            var context = new ExecutionContext(DebuggingService.GetExecutionHandler(), IdeApp.Workbench.ProgressMonitors.ConsoleFactory, IdeApp.Workspace.ActiveExecutionTarget);

            return(opers.ExecuteFile(file, context));
        }
示例#25
0
 protected override void Run()
 {
     DebuggingService.ShowDisassembly();
 }
        public PreviewVisualizerWindow(ObjectValue val, Gtk.Widget invokingWidget) : base(Gtk.WindowType.Toplevel)
        {
            this.TypeHint  = WindowTypeHint.PopupMenu;
            this.Decorated = false;
            if (((Gtk.Window)invokingWidget.Toplevel).Modal)
            {
                this.Modal = true;
            }
            TransientFor = (Gtk.Window)invokingWidget.Toplevel;

            Theme.SetBackgroundColor(Styles.PreviewVisualizerBackgroundColor.ToCairoColor());
            Theme.Padding = 3;
            ShowArrow     = true;
            var mainBox     = new VBox();
            var headerTable = new Table(1, 3, false);

            headerTable.ColumnSpacing = 5;
            var closeButton = new ImageButton()
            {
                InactiveImage = ImageService.GetIcon("md-popup-close", IconSize.Menu),
                Image         = ImageService.GetIcon("md-popup-close-hover", IconSize.Menu)
            };

            closeButton.SetCommonAccessibilityAttributes("Preview visualizer close button", GettextCatalog.GetString("Close"), null);
            closeButton.Clicked += delegate {
                this.Destroy();
            };
            var hb = new HBox();
            var vb = new VBox();

            hb.PackStart(vb, false, false, 0);
            vb.PackStart(closeButton, false, false, 0);
            headerTable.Attach(hb, 0, 1, 0, 1);

            var headerTitle = new Label();

            headerTitle.ModifyFg(StateType.Normal, Styles.PreviewVisualizerHeaderTextColor.ToGdkColor());
            var font = IdeServices.FontService.SansFont.CopyModified(Ide.Gui.Styles.FontScale12);

            font.Weight = Pango.Weight.Bold;
            headerTitle.ModifyFont(font);
            headerTitle.Text = val.TypeName;
            var vbTitle = new VBox();

            vbTitle.PackStart(headerTitle, false, false, 3);
            headerTable.Attach(vbTitle, 1, 2, 0, 1);

            if (DebuggingService.HasValueVisualizers(val))
            {
                var openButton = new Button();
                openButton.Label    = GettextCatalog.GetString("Open");
                openButton.Relief   = ReliefStyle.Half;
                openButton.Clicked += delegate {
                    PreviewWindowManager.DestroyWindow();
                    DebuggingService.ShowValueVisualizer(val);
                };
                var hbox = new HBox();
                hbox.PackEnd(openButton, false, false, 2);
                headerTable.Attach(hbox, 2, 3, 0, 1);
            }
            else
            {
                headerTable.Attach(new Label(), 2, 3, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 10, 0);
            }
            mainBox.PackStart(headerTable);
            mainBox.ShowAll();

            var     previewVisualizer = DebuggingService.GetPreviewVisualizer(val);
            Control widget            = null;

            try {
                widget = previewVisualizer?.GetVisualizerWidget(val);
            } catch (EvaluatorException ex) {
                widget = CreateErrorPreview(ex.Message);
            } catch (Exception e) {
                LoggingService.LogInternalError("Exception during preview widget creation", e);
            }
            if (widget == null)
            {
                try {
                    genericPreview = new GenericPreviewVisualizer();
                    widget         = genericPreview.GetVisualizerWidget(val);
                } catch (EvaluatorException ex) {
                    widget = CreateErrorPreview(ex.Message);
                } catch (Exception ex) {
                    widget = CreateErrorPreview(GettextCatalog.GetString("There was an error retrieving the value"));
                    LoggingService.LogInternalError(ex);
                }
            }
            var alignment = new Alignment(0, 0, 1, 1);

            alignment.SetPadding(3, 5, 5, 5);
            alignment.Show();
            alignment.Add(widget);
            mainBox.PackStart(alignment);
            ContentBox.Add(mainBox);
        }
示例#27
0
 protected override void Update(CommandInfo info)
 {
     info.Visible = DebuggingService.IsFeatureSupported(DebuggerFeatures.Catchpoints);
     info.Enabled = !DebuggingService.Breakpoints.IsReadOnly;
 }
        public static bool CanDebug(this ProjectOperations opers, IBuildTarget entry)
        {
            ExecutionContext context = new ExecutionContext(DebuggingService.GetExecutionHandler(), IdeApp.Workbench.ProgressMonitors);

            return(opers.CanExecute(entry, context));
        }
示例#29
0
 protected override void Run()
 {
     DebuggingService.ShowExpressionEvaluator(null);
 }
        public static IAsyncOperation DebugFile(this ProjectOperations opers, string file)
        {
            ExecutionContext context = new ExecutionContext(DebuggingService.GetExecutionHandler(), IdeApp.Workbench.ProgressMonitors);

            return(opers.ExecuteFile(file, context));
        }
示例#31
0
 protected override void Run()
 {
     DebuggingService.ShowNextStatement();
 }
示例#32
0
		protected override void Update (CommandInfo info)
		{
			info.Visible = DebuggingService.IsFeatureSupported (DebuggerFeatures.Disassembly);
			info.Enabled = IdeApp.Workspace.IsOpen;
		}
示例#33
0
 protected override void Update(CommandInfo info)
 {
     info.Enabled = DebuggingService.IsDebugging && DebuggingService.DebuggerSession.AttachedToProcess;
     info.Visible = DebuggingService.IsFeatureSupported(DebuggerFeatures.Attaching);
 }
示例#34
0
 public bool CanExecute(ExecutionCommand command)
 {
     SupportedFeatures = DebuggingService.GetSupportedFeaturesForCommand(command);
     return(SupportedFeatures != DebuggerFeatures.None);
 }
示例#35
0
 protected override void Run()
 {
     DebuggingService.StepOut();
 }
示例#36
0
        bool InsertProxyChildren(DebuggingService dbgr, DebuggerTypeProxyAttribute pattr, TreeIter parent, ITargetStructObject sobj)
        {
            Mono.Debugger.StackFrame frame = dbgr.MainThread.CurrentFrame;
             		ITargetStructType proxy_type = frame.Language.LookupType (frame, pattr.ProxyTypeName) as ITargetStructType;
            if (proxy_type == null)
                proxy_type = frame.Language.LookupType (frame,
                                    sobj.Type.Name + "+" + pattr.ProxyTypeName) as ITargetStructType;
            if (proxy_type != null) {
                string name = String.Format (".ctor({0})", sobj.Type.Name);
                ITargetMethodInfo method = null;

                foreach (ITargetMethodInfo m in proxy_type.Constructors) {
                    if (m.FullName == name)
                        method = m;
                }

                if (method != null) {
                    ITargetFunctionObject ctor = proxy_type.GetConstructor (frame, method.Index);
                    ITargetObject[] args = new ITargetObject[1];
                    args[0] = sobj;

                    ITargetStructObject proxy_obj = ctor.Type.InvokeStatic (frame, args, false) as ITargetStructObject;

                    if (proxy_obj != null) {
                        foreach (ITargetPropertyInfo prop in proxy_obj.Type.Properties) {
                            InsertStructMember (parent, proxy_obj, prop, false);
                        }

                        TreeIter iter = store.Append (parent);
                        store.SetValue (iter, NAME_COL, "Raw View");
                        store.SetValue (iter, RAW_VIEW_COL, true);

                        Gdk.Pixbuf icon = Runtime.Gui.Resources.GetIcon (Stock.Class, Gtk.IconSize.Menu);
                        if (icon != null)
                            store.SetValue (iter, PIXBUF_COL, icon);

                        iters.Remove (iter);
                        AddPlaceholder (sobj, iter);

                        return true;
                    }
                }
            }

            return false;
        }