Add several "quit with live inferior" tests
authorPedro Alves <palves@redhat.com>
Tue, 17 Oct 2017 13:58:54 +0000 (14:58 +0100)
committerPedro Alves <palves@redhat.com>
Tue, 17 Oct 2017 13:58:54 +0000 (14:58 +0100)
commit8484c9554519c25c73a349d0581cc269f102c5d2
tree35ae4780ec8c4f27a67ea46cf73026102a017275
parent30f0b1015897466fb88ed26c56a0b4f42808edbc
Add several "quit with live inferior" tests

In my multi-target branch, I had managed to break GDB exiting
successfuly in response to "quit" or SIGHUP/SIGTERM when:

 - you're debugging with "target extended-remote",
 - have more than one inferior loaded in gdb, some running, and at
   least one not running, and,
 - quit gdb with the inferior that is not running yet selected.

The testsuite still passed cleanly anyway.  I only noticed because I
was left with a bunch of core dumps in the gdb/testsuite/ directory --
the testsuite infrastructure closes GDB's pty after running each
testcase, which results in GDB getting a SIGHUP and should make GDB
exit gracefully.  If GDB crashes at that point though, there's no
indication about it in gdb.sum/gdb.log.

This commit adds a multitude of tests exercising quitting GDB with
live inferiors, some of which would have caught the problem.

gdb/testsuite/ChangeLog:
2017-10-17  Pedro Alves  <palves@redhat.com>

* gdb.base/quit-live.c: New file.
* gdb.base/quit-live.exp: New file.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/quit-live.c [new file with mode: 0644]
gdb/testsuite/gdb.base/quit-live.exp [new file with mode: 0644]