コード例 #1
0
        public DebuggerOptionsPanelWidget()
        {
            this.Build();
            options = DebuggingService.GetUserOptions();
            projectCodeOnly.Active    = options.ProjectAssembliesOnly;
            checkAllowEval.Active     = options.EvaluationOptions.AllowTargetInvoke;
            checkToString.Active      = options.EvaluationOptions.AllowToStringCalls;
            checkShowBaseGroup.Active = !options.EvaluationOptions.FlattenHierarchy;
            checkGroupPrivate.Active  = options.EvaluationOptions.GroupPrivateMembers;
            checkGroupStatic.Active   = options.EvaluationOptions.GroupStaticMembers;
            checkToString.Sensitive   = checkAllowEval.Active;
            spinTimeout.Value         = options.EvaluationOptions.EvaluationTimeout;

            // Debugger priorities
            engineStore      = new Gtk.ListStore(typeof(string), typeof(string));
            engineList.Model = engineStore;
            engineList.AppendColumn("", new Gtk.CellRendererText(), "text", 1);

            foreach (DebuggerEngine engine in DebuggingService.GetDebuggerEngines())
            {
                engineStore.AppendValues(engine.Id, engine.Name);
            }
            UpdatePriorityButtons();
            engineList.Selection.Changed += HandleEngineListSelectionChanged;
        }
コード例 #2
0
        bool Refresh()
        {
            procEngines = new Dictionary <long, List <DebuggerEngine> > ();
            procs       = new List <ProcessInfo> ();

            foreach (DebuggerEngine de in DebuggingService.GetDebuggerEngines())
            {
                if ((de.SupportedFeatures & DebuggerFeatures.Attaching) == 0)
                {
                    continue;
                }
                try {
                    var infos = de.GetAttachableProcesses();
                    foreach (ProcessInfo pi in infos)
                    {
                        List <DebuggerEngine> engs;
                        if (!procEngines.TryGetValue(pi.Id, out engs))
                        {
                            engs = new List <DebuggerEngine> ();
                            procEngines [pi.Id] = engs;
                            procs.Add(pi);
                        }
                        engs.Add(de);
                    }
                } catch (Exception ex) {
                    LoggingService.LogError("Could not get attachable processes.", ex);
                }
                comboDebs.AppendText(de.Name);
            }

            FillList();
            return(true);
        }
コード例 #3
0
        public AttachToProcessDialog()
        {
            this.Build();

            store      = new Gtk.ListStore(typeof(ProcessInfo), typeof(string), typeof(string));
            tree.Model = store;
            tree.AppendColumn("PID", new Gtk.CellRendererText(), "text", 1);
            tree.AppendColumn("Process Name", new Gtk.CellRendererText(), "text", 2);

            DebuggerEngine[] debEngines = DebuggingService.GetDebuggerEngines();
            foreach (DebuggerEngine de in debEngines)
            {
                if ((de.SupportedFeatures & DebuggerFeatures.Attaching) == 0)
                {
                    continue;
                }
                try
                {
                    foreach (ProcessInfo pi in de.GetAttachableProcesses())
                    {
                        List <DebuggerEngine> engs;
                        if (!procEngines.TryGetValue(pi.Id, out engs))
                        {
                            engs = new List <DebuggerEngine> ();
                            procEngines [pi.Id] = engs;
                            procs.Add(pi);
                        }
                        engs.Add(de);
                    }
                }
                catch (Exception ex)
                {
                    LoggingService.LogError("Could not get attachablbe processes.", ex);
                }
                comboDebs.AppendText(de.Name);
            }

            state = new TreeViewState(tree, 1);

            FillList();

            comboDebs.Sensitive     = false;
            buttonOk.Sensitive      = false;
            tree.Selection.Changed += OnSelectionChanged;

            Gtk.TreeIter it;
            if (store.GetIterFirst(out it))
            {
                tree.Selection.SelectIter(it);
            }
        }
コード例 #4
0
        void Refresh()
        {
            while (!closed)
            {
                var procEngines = new Dictionary <long, List <DebuggerEngine> > ();
                var procs       = new List <ProcessInfo> ();

                foreach (DebuggerEngine de in DebuggingService.GetDebuggerEngines())
                {
                    if ((de.SupportedFeatures & DebuggerFeatures.Attaching) == 0)
                    {
                        continue;
                    }
                    try {
                        var infos = de.GetAttachableProcesses();
                        foreach (ProcessInfo pi in infos)
                        {
                            List <DebuggerEngine> engs;
                            if (!procEngines.TryGetValue(pi.Id, out engs))
                            {
                                engs = new List <DebuggerEngine> ();
                                procEngines [pi.Id] = engs;
                                procs.Add(pi);
                            }
                            engs.Add(de);
                        }
                    } catch (Exception ex) {
                        LoggingService.LogError("Could not get attachable processes.", ex);
                    }
                }
                this.procEngines = procEngines;
                this.procs       = procs;
                Runtime.RunInMainThread(new Action(FillList)).Ignore();
                Thread.Sleep(3000);
            }
        }
コード例 #5
0
        public AttachToProcessDialog()
        {
            this.Build();

            store      = new Gtk.ListStore(typeof(ProcessInfo), typeof(string), typeof(string), typeof(string));
            tree.Model = store;
            tree.AppendColumn("PID", new Gtk.CellRendererText(), "text", 1);
            tree.AppendColumn(GettextCatalog.GetString("Name"), new Gtk.CellRendererText(), "text", 2);
            tree.AppendColumn(GettextCatalog.GetString("Description"), new Gtk.CellRendererText(), "text", 3);
            tree.RowActivated += OnRowActivated;

            state = new TreeViewState(tree, 1);

            buttonOk.Sensitive = false;
            tree.Selection.UnselectAll();
            tree.Selection.Changed += OnSelectionChanged;

            Gtk.TreeIter it;
            if (store.GetIterFirst(out it))
            {
                tree.Selection.SelectIter(it);
            }

            //Logic below tries to CreateExecutionCommand which is used to determine default debug engine
            var startupConfig = IdeApp.ProjectOperations.CurrentSelectedSolution?.StartupConfiguration as SingleItemSolutionRunConfiguration;
            ExecutionCommand executionCommand = null;

            if (startupConfig?.Item is DotNetProject dnp)
            {
                var config = dnp.GetConfiguration(IdeApp.Workspace.ActiveConfiguration) as DotNetProjectConfiguration;
                var runProjectConfiguration = startupConfig.RunConfiguration as ProjectRunConfiguration ?? dnp.GetDefaultRunConfiguration() as ProjectRunConfiguration;
                if (config != null)
                {
                    executionCommand = dnp.CreateExecutionCommand(IdeApp.Workspace.ActiveConfiguration, config, runProjectConfiguration);
                }
            }
            DebuggerEngine defaultEngine = null;

            foreach (DebuggerEngine de in DebuggingService.GetDebuggerEngines())
            {
                if ((de.SupportedFeatures & DebuggerFeatures.Attaching) == 0)
                {
                    continue;
                }
                if (executionCommand != null && de.CanDebugCommand(executionCommand))
                {
                    defaultEngine = de;
                }
                debugEngines.Add(de);
                comboDebs.AppendText(de.Name);
            }
            if (!debugEngines.Any())
            {
                return;
            }
            if (defaultEngine == null)
            {
                defaultEngine = debugEngines.First();
            }
            comboDebs.Active = debugEngines.IndexOf(defaultEngine);
            ChangeEngine(defaultEngine);
            comboDebs.Changed += delegate {
                ChangeEngine(debugEngines [comboDebs.Active]);
            };
        }