public void processingGDBOutput()
{
while (_running)
{
string response = "";
while ((response = GDBParser.removeGDBResponse()) == "" && _running)
{
};
// Creating a char delimiter that will be used to split the response in more than one event
response = response.Replace("\r\n", "@");
string[] events = response.Split('@');
foreach (string ev in events)
{
if (ev.Length > 1) // only to avoid empty events, when there are two delimiters characters together.
{
if (m_eventDispatcher.countSIGINT > 0)
if ((ev.Substring(0, 2) != "50") && (ev.Substring(0, 2) != "80"))
m_eventDispatcher.countSIGINT = 0; // Reset the counter, if GDB has recovered from a GDB bug.
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. Not used.
break;
case '7': // Events related to stack frames. Not used.
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 that was not parsed correctly, or not handled completely.
break;
}
}
}
}
}