public void processingGDBOutput() { // string verify = ""; while (_running) { string response = ""; while ((response = GDBParser.removeGDBResponse()) == "" && _running) { }; response = response.Replace("\r\n", "@"); // creating a char delimiter that will be used to split the response in more than one event string[] events = response.Split('@'); foreach (string ev in events) { // verify += ev; if (ev.Length > 1) // only to avoid empty events, in case there are two delimiters together. { if (m_eventDispatcher.countSIGINT > 0) if ((ev.Substring(0, 2) != "50") && (ev.Substring(0, 2) != "80")) m_eventDispatcher.countSIGINT = 0; switch (ev[0]) { case '0': // events related to starting GDB break; case '1': // not used. break; case '2': // events related to breakpoints (including breakpoint hits) m_hBreakpoints = new HandleBreakpoints(m_eventDispatcher); m_hBreakpoints.handle(ev); break; case '3': // not used. break; case '4': // events related to execution control (processes, threads, programs) 1 m_hProcExe = new HandleProcessExecution(m_eventDispatcher); m_hProcExe.handle(ev); break; case '5': // events related to execution control (processes, threads, programs and GDB Bugs) 2 m_hProcExe = new HandleProcessExecution(m_eventDispatcher); m_hProcExe.handle(ev); break; case '6': // events related to evaluating expressions break; case '7': // events related to stack frames. break; case '8': // events related to output m_hOutputs = new HandleOutputs(m_eventDispatcher); m_hOutputs.handle(ev); break; case '9': // not used. break; default: // event not parsed correctly, or not implemented completely. break; } } } } }