Ejemplo n.º 1
0
        void HandleGdbEvent(object sender, string ev)
        {
            if (ev[0] != '%')
            {
                return;
            }

            DebuggerChangeEventArgs.DebuggerStatus oldStatus = debuggerStatus;

            if (ev == "%cont")
            {
                debuggerStatus = DebuggerChangeEventArgs.DebuggerStatus.Waiting;
            }
            else if (ev == "%stop")
            {
                debuggerStatus = DebuggerChangeEventArgs.DebuggerStatus.Break;
            }
            else if (ev == "%exit")
            {
                debuggerStatus = DebuggerChangeEventArgs.DebuggerStatus.Detaching;
            }

            if (debuggerStatus != oldStatus)
            {
                NotifyDebuggerChange(debuggerStatus);
            }

            // Now check for process/thread events
            string processChange = "%proc ";
            string threadChange  = "%thread ";

            if (ev.StartsWith(processChange))
            {
                this.targetProcess = UInt32.Parse(ev.Substring(processChange.Length));
                NotifyDebuggerChange(DebuggerChangeEventArgs.DebuggerStatus.ChangingProcess);
            }
            else if (ev.StartsWith(threadChange))
            {
                this.targetThread = UInt32.Parse(ev.Substring(threadChange.Length));
                NotifyDebuggerChange(DebuggerChangeEventArgs.DebuggerStatus.ChangingThread);
            }
        }
Ejemplo n.º 2
0
 internal void NotifyDebuggerStatusChange(DebuggerChangeEventArgs.DebuggerStatus status)
 {
     this.DebuggerChange?.Invoke(this, new DebuggerChangeEventArgs(status));
 }