From 526b1b7ec8da5b770a345a2ea1b3f7471a533d44 Mon Sep 17 00:00:00 2001 From: Alexandru Dutu Date: Tue, 4 Oct 2016 13:04:19 -0400 Subject: [PATCH] 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. --- src/base/remote_gdb.cc | 6 ++++++ 1 file changed, 6 insertions(+) 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); -- 2.30.2