misc: Adds a warning in case gdb is attached multiple times

Instead of scheduling another event, this patch adds a warning in case gdb
is attached multiple times and the first attachement event has not been
processed yet.
This commit is contained in:
Alexandru Dutu 2016-10-04 13:04:19 -04:00
parent c8cf71f1a0
commit 526b1b7ec8

View file

@ -249,6 +249,12 @@ BaseRemoteGDB::InputEvent::InputEvent(BaseRemoteGDB *g, int fd, int e)
void
BaseRemoteGDB::InputEvent::process(int revent)
{
if (gdb->trapEvent.scheduled()) {
warn("GDB trap event has already been scheduled! "
"Ignoring this input event.");
return;
}
if (revent & POLLIN) {
gdb->trapEvent.type(SIGILL);
gdb->scheduleInstCommitEvent(&gdb->trapEvent, 0);