summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Dutu <alexandru.dutu@amd.com>2016-10-04 13:04:19 -0400
committerAlexandru Dutu <alexandru.dutu@amd.com>2016-10-04 13:04:19 -0400
commit526b1b7ec8da5b770a345a2ea1b3f7471a533d44 (patch)
tree037dc621a77c447eb5abf443d5489ae05e17d252
parentc8cf71f1a046b4758e20d6398a654777c3fb5193 (diff)
downloadgem5-526b1b7ec8da5b770a345a2ea1b3f7471a533d44.tar.xz
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.
-rw-r--r--src/base/remote_gdb.cc6
1 files changed, 6 insertions, 0 deletions
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);