testsuite: Extend TLS core file testing with an OS-generated dump
authorMaciej W. Rozycki <macro@mips.com>
Thu, 24 May 2018 14:31:32 +0000 (15:31 +0100)
committerPedro Alves <palves@redhat.com>
Thu, 24 May 2018 14:31:32 +0000 (15:31 +0100)
commitd9f6d7f8b636a2b32004273143d72a77d82b40de
treed1591222d271e0a34daa4f4e3cc2a4377da83c5c
parentda05d921f0b7b9f9f07ac4e78ee228e7ecf847e0
testsuite: Extend TLS core file testing with an OS-generated dump

Complementing commit 280ca31f4d60 ("Add test for fetching TLS from
core file") extend gdb.threads/tls-core.exp with an OS-generated dump
where supported.

This verifies not only that our core dump interpreter is consistent
with our producer, but that it matches the OS verified as well,
avoiding a possible case where our interpreter would be bug-compatible
with our producer but not the OS and it would go unnoticed in testing.

This results in:

 PASS: gdb.threads/tls-core.exp: native: load core file
 PASS: gdb.threads/tls-core.exp: native: print thread-local storage variable
 PASS: gdb.threads/tls-core.exp: gcore: load core file
 PASS: gdb.threads/tls-core.exp: gcore: print thread-local storage variable

with local testing and:

 UNSUPPORTED: gdb.threads/tls-core.exp: native: load core file
 UNSUPPORTED: gdb.threads/tls-core.exp: native: print thread-local storage variable
 PASS: gdb.threads/tls-core.exp: gcore: load core file
 PASS: gdb.threads/tls-core.exp: gcore: print thread-local storage variable

with remote testing, or for testing on ports that don't supports
cores.

gdb/testsuite/ChangeLog:
2018-05-24  Maciej W. Rozycki  <macro@mips.com>
    Pedro Alves  <palves@redhat.com>

* gdb.threads/tls-core.c: Include <stdlib.h>
(thread_proc): Call `abort'.
* gdb.threads/tls-core.exp: Generate a core with core_find too.
(tls_core_test): New procedure, bits factored out from ...
(top level): ... here.  Test both native cores and gcore cores.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/tls-core.c
gdb/testsuite/gdb.threads/tls-core.exp