Beispiel #1
0
        void Target_StateUpdate(Target sender, StateUpdateEventArgs args)
        {
            mTargetStatus = args.TargetState;

            if (args.TargetState == TargetState.Disconnected)
            {
                Disconnect(false, false);
                mMainWindowComponents.targetStateLabel.Text = "";
                Connect(mHostInfo);
            }
            else if (args.TargetState == TargetState.Connected)
            {
                HideStatusMessage();

                // Tell everyone the good news
                OnDebuggerConnected(mConnectedTarget);

                SetNotification(Tilde.LuaDebugger.Properties.Resources.SystrayConnected, "Tilde connected", "Connection established to " + mConnectedTarget.HostInfo.ToString());

                // Send breakpoints
                foreach (BreakpointDetails bkpt in mBreakpoints)
                {
                    if (bkpt.Enabled)
                    {
                        bkpt.TargetState = BreakpointState.PendingAdd;
                        mConnectedTarget.AddBreakpoint(bkpt.FileName, bkpt.Line, bkpt.ID);
                    }
                    else
                    {
                        bkpt.TargetState = BreakpointState.NotSent;
                    }
                    OnBreakpointChanged(bkpt, true);
                }

                // Send watches
                foreach (WatchDetails watch in mWatches.Values)
                {
                    if (watch.Enabled)
                    {
                        watch.State = WatchState.PendingAdd;
                        mConnectedTarget.AddWatch(watch.Expression, watch.ID);
                    }
                    else
                    {
                        watch.State = WatchState.NotSent;
                    }
                }

                // Request threads
                mConnectedTarget.RetrieveThreads();

                mMainWindowComponents.targetStateLabel.Text = "CONNECTED";
                mCurrentThread = LuaValue.nil;
            }
            else if (args.TargetState == TargetState.Running)
            {
                mMainWindowComponents.targetStateLabel.Text = "RUN";
                mCurrentThread    = LuaValue.nil;
                CurrentStackFrame = null;
            }
            else if (args.TargetState == TargetState.Breaked)
            {
                mMainWindowComponents.targetStateLabel.Text = "BREAK";
                mCurrentThread = args.Thread;
                Manager.FlashMainWindow();
            }
            else if (args.TargetState == TargetState.Error)
            {
                mMainWindowComponents.targetStateLabel.Text = "ERROR";
                mCurrentThread = args.Thread;
            }
            else if (args.TargetState == TargetState.Finished)
            {
                mMainWindowComponents.targetStateLabel.Text = "FINISH";
                mCurrentThread    = LuaValue.nil;
                CurrentStackFrame = null;
            }
        }
Beispiel #2
0
 void target_StateUpdate(Target sender, StateUpdateEventArgs args)
 {
 }