Exemple #1
0
        public MainForm()
        {
            InitializeComponent();

            _client = new xdc.XDebug.Client("localhost", 9000);
            _client.EventCallback += new XDebugEventHandler(XDebugEventCallback);

            // Get the forms up.
            _statusFrm    = new xdc.Forms.StatusForm();
            _callstackFrm = new xdc.Forms.CallstackForm();
            _localContextFrm = new xdc.Forms.ContextForm(_client, "Locals"); // todo, name etc
            _globalContextFrm = new xdc.Forms.ContextForm(_client, "Globals"); // todo, name etc

            // Helper objects
            _breakpointMgr = new BreakpointManager();
            _fileMgr = new FileManager();

            // Handlers
            _callstackFrm.StackSelected += new EventHandler<xdc.Forms.StackEventArgs>(_callstackFrm_StackSelected);

            _CurrentLocation = new Location();
            _CurrentLocation.line = -1;

            this.KeyPreview = true;

            this.ToggleMenuItems(false);
        }
Exemple #2
0
        void _callstackFrm_StackSelected(object sender, xdc.Forms.StackEventArgs e)
        {
            Location loc = new Location();
            loc.filename = e.StackEntry.fileName;
            loc.line = e.StackEntry.lineNumber - 1;

            _client.StackDepth = e.StackEntry.level;

            this.PrepareFileForAccess(loc.filename);
            this.SetActiveFileAndLine(loc);
            // re get context
            List<Property> ctx = _client.GetContext("0");
            _localContextFrm.LoadPropertyList(ctx);
            ctx = _client.GetContext("1");
            _globalContextFrm.LoadPropertyList(ctx);
        }
Exemple #3
0
        private void SetActiveFileAndLine(Location location)
        {
            if (_CurrentLocation.line != -1)
            {
                xdc.Forms.SourceFileForm previousFile = _fileMgr.getFormByRemoteFilename(_CurrentLocation.filename);
                if (previousFile != null)
                {
                    previousFile.RemoveActiveMark();
                }
            }

            _CurrentLocation.line = location.line;
            _CurrentLocation.filename = location.filename;

            xdc.Forms.SourceFileForm currentFile = _fileMgr.getFormByRemoteFilename(location.filename);

            currentFile.SetActiveMark(_CurrentLocation.line);
            currentFile.Focus();
            currentFile.BringToFront();
        }