From: Alexandru Dutu Date: Tue, 4 Oct 2016 17:04:19 +0000 (-0400) Subject: misc: Adds a warning in case gdb is attached multiple times X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=526b1b7ec8da5b770a345a2ea1b3f7471a533d44;p=gem5.git 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. --- diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc index e033bea9c..a22ba9fbe 100644 --- a/src/base/remote_gdb.cc +++ b/src/base/remote_gdb.cc @@ -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);