Esempio n. 1
0
        public void UpdateDisplay()
        {
            if (tree.IsRealized)
            {
                tree.ScrollToPoint(0, 0);
            }

            treeState.Save();

            store.Clear();
            if (breakpoints != null)
            {
                lock (breakpoints) {
                    foreach (BreakEvent be in breakpoints.GetBreakevents())
                    {
                        if (be.NonUserBreakpoint)
                        {
                            continue;
                        }
                        string hitCount = be.HitCountMode != HitCountMode.None ? be.CurrentHitCount.ToString() : "";
                        string traceExp = (be.HitAction & HitAction.PrintExpression) != HitAction.None ? be.TraceExpression : "";
                        string traceVal = (be.HitAction & HitAction.PrintExpression) != HitAction.None ? be.LastTraceValue : "";
                        string name;

                        var fb = be as FunctionBreakpoint;
                        var bp = be as Breakpoint;
                        var cp = be as Catchpoint;
                        if (fb != null)
                        {
                            if (fb.ParamTypes != null)
                            {
                                name = fb.FunctionName + "(" + string.Join(", ", fb.ParamTypes) + ")";
                            }
                            else
                            {
                                name = fb.FunctionName;
                            }
                        }
                        else if (bp != null)
                        {
                            name = String.Format("{0}:{1},{2}", bp.FileName, bp.Line, bp.Column);
                        }
                        else if (cp != null)
                        {
                            name = cp.ExceptionName;
                        }
                        else
                        {
                            name = "";
                        }

                        store.AppendValues(GetIconId(be), be.Enabled, name, be, bp != null ? bp.ConditionExpression : null, traceExp, hitCount, traceVal);
                    }
                }
            }

            treeState.Load();
        }
Esempio n. 2
0
        void Update()
        {
            if (tree.IsRealized)
            {
                tree.ScrollToPoint(0, 0);
            }

            needsUpdate = false;
            store.Clear();

            if (!DebuggingService.IsPaused)
            {
                return;
            }

            var options   = DebuggingService.DebuggerSession.Options.EvaluationOptions;
            var backtrace = DebuggingService.CurrentCallStack;

            for (int i = 0; i < backtrace.FrameCount; i++)
            {
                string icon;
                if (i == DebuggingService.CurrentFrameIndex)
                {
                    icon = Gtk.Stock.GoForward;
                }
                else
                {
                    icon = null;
                }

                StackFrame frame = backtrace.GetFrame(i);
                if (frame.IsDebuggerHidden)
                {
                    continue;
                }

                var method = EvaluateMethodName(frame, options);

                string file;
                if (!string.IsNullOrEmpty(frame.SourceLocation.FileName))
                {
                    file = frame.SourceLocation.FileName;
                    if (frame.SourceLocation.Line != -1)
                    {
                        file += ":" + frame.SourceLocation.Line;
                    }
                }
                else
                {
                    file = string.Empty;
                }

                var style = frame.IsExternalCode ? Pango.Style.Italic : Pango.Style.Normal;

                store.AppendValues(icon, method, file, frame.Language, "0x" + frame.Address.ToString("x"), null,
                                   style, frame, i, !options.AllowDisplayStringEvaluation);
            }
        }
Esempio n. 3
0
        public void UpdateDisplay()
        {
            if (tree.IsRealized)
            {
                tree.ScrollToPoint(0, 0);
            }

            treeState.Save();

            store.Clear();
            if (breakpoints != null)
            {
                lock (breakpoints) {
                    foreach (Breakpoint bp in breakpoints.GetBreakpoints())
                    {
                        string hitCount = bp.HitCountMode != HitCountMode.None ? bp.CurrentHitCount.ToString() : "";
                        string traceExp = bp.HitAction == HitAction.PrintExpression ? bp.TraceExpression : "";
                        string traceVal = bp.HitAction == HitAction.PrintExpression ? bp.LastTraceValue : "";
                        string name;

                        if (bp is FunctionBreakpoint)
                        {
                            FunctionBreakpoint fb = (FunctionBreakpoint)bp;

                            if (fb.ParamTypes != null)
                            {
                                name = fb.FunctionName + "(" + string.Join(", ", fb.ParamTypes) + ")";
                            }
                            else
                            {
                                name = fb.FunctionName;
                            }
                        }
                        else
                        {
                            name = string.Format("{0}:{1},{2}", ((Breakpoint)bp).FileName, bp.Line, bp.Column);
                        }

                        if (bp.Enabled)
                        {
                            store.AppendValues("md-breakpoint", true, name, bp, bp.ConditionExpression, traceExp, hitCount, traceVal);
                        }
                        else
                        {
                            store.AppendValues("md-breakpoint-disabled", false, name, bp, bp.ConditionExpression, traceExp, hitCount, traceVal);
                        }
                    }
                }
            }

            treeState.Load();
        }
Esempio n. 4
0
 private void Clear()
 {
     errorCount = warningCount = infoCount = 0;
     if (view.IsRealized)
     {
         view.ScrollToPoint(0, 0);
     }
     store.Clear();
     tasks.Clear();
     UpdateErrorsNum();
     UpdateWarningsNum();
     UpdateMessagesNum();
 }
Esempio n. 5
0
        void Update()
        {
            if (tree.IsRealized)
            {
                tree.ScrollToPoint(0, 0);
            }

            treeViewState.Save();

            store.Clear();

            try {
                if (DebuggingService.GetSessions().SelectMany(s => s.GetProcesses()).Count() > 1)
                {
                    foreach (var session in DebuggingService.GetSessions())
                    {
                        foreach (var process in session.GetProcesses())
                        {
                            var iter = store.AppendValues(
                                session.IsRunning ? "md-continue-debug" : "md-pause-debug",
                                process.Id.ToString(),
                                process.Name,
                                process,
                                session == DebuggingService.DebuggerSession ? (int)Pango.Weight.Bold : (int)Pango.Weight.Normal,
                                "",
                                session);
                            if (session.IsRunning)
                            {
                                continue;
                            }
                            AppendThreads(iter, process, session);
                        }
                    }
                }
                else
                {
                    if (!DebuggingService.IsPaused)
                    {
                        return;
                    }
                    AppendThreads(TreeIter.Zero, DebuggingService.DebuggerSession.GetProcesses() [0], DebuggingService.DebuggerSession);
                }
            } catch (Exception ex) {
                LoggingService.LogInternalError(ex);
            }

            tree.ExpandAll();

            treeViewState.Load();
        }
Esempio n. 6
0
        void Update()
        {
            if (tree.IsRealized)
            {
                tree.ScrollToPoint(0, 0);
            }

            needsUpdate = false;
            store.Clear();

            if (!DebuggingService.IsPaused)
            {
                return;
            }

            var backtrace = DebuggingService.CurrentCallStack;

            for (int i = 0; i < backtrace.FrameCount; i++)
            {
                bool icon = i == DebuggingService.CurrentFrameIndex;

                StackFrame frame = backtrace.GetFrame(i);
                if (frame.IsDebuggerHidden)
                {
                    continue;
                }

                var method = EvaluateMethodName(frame);

                string file;
                if (!string.IsNullOrEmpty(frame.SourceLocation.FileName))
                {
                    file = frame.SourceLocation.FileName;
                    if (frame.SourceLocation.Line != -1 && ShowLineNumber)
                    {
                        file += ":" + frame.SourceLocation.Line;
                    }
                }
                else
                {
                    file = string.Empty;
                }

                var style = frame.IsExternalCode ? Pango.Style.Italic : Pango.Style.Normal;

                store.AppendValues(icon, method, file, frame.Language, "0x" + frame.Address.ToString("x"), null,
                                   style, frame, i);
            }
        }
Esempio n. 7
0
        void Update()
        {
            if (tree.IsRealized)
            {
                tree.ScrollToPoint(0, 0);
            }

            treeViewState.Save();

            store.Clear();

            if (!DebuggingService.IsPaused)
            {
                return;
            }

            try {
                ProcessInfo[] currentProcesses = DebuggingService.DebuggerSession.GetProcesses();

                if (currentProcesses.Length == 1)
                {
                    AppendThreads(TreeIter.Zero, currentProcesses [0]);
                }
                else
                {
                    foreach (ProcessInfo p in currentProcesses)
                    {
                        TreeIter it = store.AppendValues(null, p.Id.ToString(), p.Name, p, (int)Pango.Weight.Normal, "");
                        AppendThreads(it, p);
                    }
                }
            } catch (Exception ex) {
                MessageService.ShowException(ex);
            }

            tree.ExpandAll();

            treeViewState.Load();
        }
Esempio n. 8
0
        void Update()
        {
            if (tree.IsRealized)
            {
                tree.ScrollToPoint(0, 0);
            }

            treeViewState.Save();

            store.Clear();

            if (!DebuggingService.IsPaused)
            {
                return;
            }

            try {
                var processes = DebuggingService.DebuggerSession.GetProcesses();

                if (processes.Length == 1)
                {
                    AppendThreads(TreeIter.Zero, processes[0]);
                }
                else
                {
                    foreach (var process in processes)
                    {
                        TreeIter iter = store.AppendValues(null, process.Id.ToString(), process.Name, process, (int)Pango.Weight.Normal, "");
                        AppendThreads(iter, process);
                    }
                }
            } catch (Exception ex) {
                LoggingService.LogInternalError(ex);
            }

            tree.ExpandAll();

            treeViewState.Load();
        }
Esempio n. 9
0
        void Update()
        {
            if (tree.IsRealized)
            {
                tree.ScrollToPoint(0, 0);
            }

            needsUpdate = false;
            store.Clear();

            if (!DebuggingService.IsPaused)
            {
                return;
            }

            var backtrace        = DebuggingService.CurrentCallStack;
            var externalCodeIter = TreeIter.Zero;

            for (int i = 0; i < backtrace.FrameCount; i++)
            {
                bool icon = i == DebuggingService.CurrentFrameIndex;

                StackFrame frame = backtrace.GetFrame(i);
                if (frame.IsDebuggerHidden)
                {
                    continue;
                }

                if (!ShowExternalCode && frame.IsExternalCode)
                {
                    if (externalCodeIter.Equals(TreeIter.Zero))
                    {
                        externalCodeIter = store.AppendValues(icon, GettextCatalog.GetString("[External Code]"), string.Empty, string.Empty, string.Empty, null, Pango.Style.Italic, null, -1);
                    }
                    else if (icon)
                    {
                        //Set IconColumn value to true if any of hidden frames is current frame
                        store.SetValue(externalCodeIter, IconColumn, true);
                    }
                    continue;
                }
                externalCodeIter = TreeIter.Zero;
                var method = EvaluateMethodName(frame);

                string file;
                if (!string.IsNullOrEmpty(frame.SourceLocation.FileName))
                {
                    file = frame.SourceLocation.FileName;
                    if (frame.SourceLocation.Line != -1 && ShowLineNumber)
                    {
                        file += ":" + frame.SourceLocation.Line;
                    }
                }
                else
                {
                    file = string.Empty;
                }

                var style = frame.IsExternalCode ? Pango.Style.Italic : Pango.Style.Normal;

                store.AppendValues(icon, method, file, frame.Language, "0x" + frame.Address.ToString("x"), null,
                                   style, frame, i);
            }
        }
Esempio n. 10
0
        async void Update()
        {
            if (tree.IsRealized)
            {
                tree.ScrollToPoint(0, 0);
            }

            needsUpdate = false;
            store.Clear();

            if (!DebuggingService.IsPaused)
            {
                return;
            }

            cancelUpdate.Cancel();
            cancelUpdate = new CancellationTokenSource();
            var token = cancelUpdate.Token;

            List <(StackFrame frame, string text)> stackFrames;

            try {
                stackFrames = await Task.Run(() => GetStackFrames());
            } catch (Exception ex) {
                LoggingService.LogInternalError(ex);
                return;
            }
            // Another fetch of all data already in progress, return
            if (token.IsCancellationRequested)
            {
                return;
            }

            var externalCodeIter = TreeIter.Zero;

            for (int i = 0; i < stackFrames.Count; i++)
            {
                bool       icon  = i == DebuggingService.CurrentFrameIndex;
                StackFrame frame = stackFrames [i].frame;
                if (frame.IsDebuggerHidden)
                {
                    continue;
                }

                if (!GetExternalCodeValue(frame.DebuggerSession.Options) && frame.IsExternalCode)
                {
                    if (externalCodeIter.Equals(TreeIter.Zero))
                    {
                        externalCodeIter = store.AppendValues(icon, GettextCatalog.GetString("[External Code]"), string.Empty, string.Empty, string.Empty, null, Pango.Style.Italic, null, -1);
                    }
                    else if (icon)
                    {
                        //Set IconColumn value to true if any of hidden frames is current frame
                        store.SetValue(externalCodeIter, IconColumn, true);
                    }
                    continue;
                }
                externalCodeIter = TreeIter.Zero;
                var method = stackFrames [i].text;

                string file;
                if (!string.IsNullOrEmpty(frame.SourceLocation.FileName))
                {
                    file = frame.SourceLocation.FileName;
                    if (frame.SourceLocation.Line != -1 && frame.DebuggerSession.EvaluationOptions.StackFrameFormat.Line)
                    {
                        file += ":" + frame.SourceLocation.Line;
                    }
                }
                else
                {
                    file = string.Empty;
                }

                var style = frame.IsExternalCode ? Pango.Style.Italic : Pango.Style.Normal;

                store.AppendValues(icon, method, file, frame.Language, "0x" + frame.Address.ToString("x"), null,
                                   style, frame, i);
            }
        }