Add test case for a known hang in infrun
authorRichard Bunt <richard.bunt@arm.com>
Fri, 20 Apr 2018 03:02:35 +0000 (23:02 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Fri, 20 Apr 2018 03:02:35 +0000 (23:02 -0400)
commitd27d16bfdc3f275b379793214db9bd9467b6f0f8
tree509cb0113e912bb29199aab78b556ead9aa5e82d
parentebf7373d2f63c7d50f3620bbf0165370cef60813
Add test case for a known hang in infrun

The hang occurs when GDB tries to call inferior functions on two
different threads with scheduler-locking turned on. The first call works
fine, with the call to infrun_async(1) causing the signal_handler to be
marked and the event to be handled, but then the event loop resets the
"ready" member to zero, while leaving infrun_is_async set to 1. As a
result, GDB hangs if the user switches to another thread and calls a
second function because calling infrun_async(1) a second time has no
effect, meaning the inferior call events are never handled.

The added test case provokes the above issue.

gdb/testsuite/ChangeLog:

* gdb.threads/multiple-successive-infcall.c: New test.
* gdb.threads/multiple-successive-infcall.exp: New file.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/multiple-successive-infcall.c [new file with mode: 0644]
gdb/testsuite/gdb.threads/multiple-successive-infcall.exp [new file with mode: 0644]