Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        private void UpdateLocalsUI()
        {
            if ((PluginBase.MainForm as Form).InvokeRequired)
            {
                (PluginBase.MainForm as Form).BeginInvoke((MethodInvoker) delegate()
                {
                    UpdateLocalsUI();
                });
                return;
            }

            if (debugger.GetNumStackFrames() > (uint)m_CurrentFrame)
            {
                DebugFrontend.StackFrame frame = debugger.GetStackFrame((uint)m_CurrentFrame);

                if (frame != null)
                {
                    CurrentLocation = new Location(frame.scriptIndex, frame.line);
                }
            }
            else
            {
                CurrentLocation = null;
            }

            PanelsHelper.watchUI.UpdateElements();
        }
Beispiel #2
0
        public Variable EvaluateCurrent(string expression)
        {
            DebugFrontend.StackFrame frame = debugger.GetStackFrame((uint)m_CurrentFrame);

            if (frame != null)
            {
                if ((int)frame.stackLevel != -1)
                {
                    string str = debugger.Evaluate(m_CurrentVM, expression, frame.stackLevel);

                    if (str.Length > 0)
                    {
                        XmlDocument xml = new XmlDocument();
                        xml.LoadXml(str);

                        return(new Variable(xml.DocumentElement, expression));
                    }
                }
            }

            return(null);
        }
Beispiel #3
0
        /// <summary>
        ///
        /// </summary>
        private void UpdateStackUI()
        {
            m_CurrentFrame = 0;

            uint num = debugger.GetNumStackFrames();

            if (num > 0)
            {
                StackFrameInfo[] frames = new StackFrameInfo[num];

                for (uint i = 0; i < debugger.GetNumStackFrames(); i++)
                {
                    DebugFrontend.StackFrame frame  = debugger.GetStackFrame(i);
                    DebugFrontend.Script     script = debugger.GetScript(frame.scriptIndex);

                    if (script != null)
                    {
                        frames[i].file      = script.name;
                        frames[i].available = true;
                    }
                    else
                    {
                        frames[i].file      = "";
                        frames[i].available = false;
                    }

                    frames[i].function = frame.function;
                    frames[i].line     = frame.line;
                }

                PanelsHelper.stackframeUI.AddFrames(frames);
            }
            else
            {
                PanelsHelper.stackframeUI.ClearItem();
            }
        }
Beispiel #4
0
        /// <summary>
        ///
        /// </summary>
        private void UpdateUI(DebuggerState state)
        {
            if ((PluginBase.MainForm as Form).InvokeRequired)
            {
                (PluginBase.MainForm as Form).BeginInvoke((MethodInvoker) delegate()
                {
                    UpdateUI(state);
                });
                return;
            }

            try
            {
                if (debugger.GetNumStackFrames() > 0)
                {
                    DebugFrontend.StackFrame frame = debugger.GetStackFrame(0);

                    CurrentLocation = new Location(frame.scriptIndex, frame.line);
                }
                else
                {
                    CurrentLocation = null;
                }

                UpdateStackUI();
                UpdateLocalsUI();
                UpdateMenuState(state);
                UpdateVirtualMachinesUI();

                (PluginBase.MainForm as Form).Activate();
            }
            catch (Exception ex)
            {
                ErrorManager.ShowError("Internal Debugger Exception", ex);
            }
        }
Beispiel #5
0
 public DebugFrontend.StackFrame GetStackFrame(uint i)
 {
     DebugFrontend.StackFrame ret = new DebugFrontend.StackFrame(DecodaPINVOKE.DebugFrontend_GetStackFrame(swigCPtr, i), false);
     return(ret);
 }