This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 0/2 V2] Fix a fail in gdb.base/interrupt-noterm.exp
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 26 Jan 2016 09:58:57 +0000
- Subject: [PATCH 0/2 V2] Fix a fail in gdb.base/interrupt-noterm.exp
- Authentication-results: sourceware.org; auth=none
- References: <86powqqa57 dot fsf at gmail dot com>
Hi,
In my test, I see the following fail intermittently,
interrupt
(gdb) PASS: gdb.base/interrupt-noterm.exp: interrupt
[Inferior 1 (process 13407) exited normally]
Child exited with status 0
FAIL: gdb.base/interrupt-noterm.exp: inferior received SIGINT (timeout)
because interrupt character isn't processed by GDBserver in time due to
two different problems:
1. GDBserver may receive vCont;c and '\003' together, and read them
into the buffer. GDBserver will wait for the inferior but there
won't be SIGIO because GDBserver has already read '\003' into the
buffer.
2. GDBserver may receive vCont;c only. GDBserver will resume the
inferior and wait for it. If '\003' arrives at the moment between
GDBserver received vCont;c and install SIGIO handler, GDBserver
can't receive SIGIO.
these two problems above cause GDB wait for the inferior and leave the
interrupt there, so the test is timeout.
Two patches in the series fix these two problems separately. Patch 1
fixes the problem 1 by checking the buffer *after* reading in each
packet. Patch 2 fixes the problem 2 by block/unblock SIGIO rather than
install/uninstall signal handler.
These two patches are tested on {x86_64,arm,aarch64}-linux. No
regression.
*** BLURB HERE ***
Yao Qi (2):
[GDBserver] Check input interrupt after reading in a packet
[GDBserver] Block and unblock SIGIO
gdb/gdbserver/remote-utils.c | 60 ++++++++++++++++++++++++++++----------------
1 file changed, 39 insertions(+), 21 deletions(-)
--
1.9.1