]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
linux: Add maintenance commands to test libthread_db users/gbenson/thread_db-test/2018-05-23
authorGary Benson <gbenson@redhat.com>
Wed, 23 May 2018 12:53:03 +0000 (13:53 +0100)
committerGary Benson <gbenson@redhat.com>
Wed, 23 May 2018 12:53:03 +0000 (13:53 +0100)
commitab3d1b33b49b6275427b50836919e4474502ac65
tree41aa4766fa1a0629852ad386574b9b8997b3b91e
parent184cde7552b5434196b8380be23b39ff4a5a17e6
linux: Add maintenance commands to test libthread_db

This commit adds two new commands which may be used to test thread
debugging libraries used by GDB:

  * "maint check libthread-db" tests the thread debugging library GDB
     is using for the current inferior.

  * "maint set/show check-libthread-db" selects whether libthread_db
     tests should be run automatically as libthread_db is auto-loaded.
     The default is to not run tests automatically.

The test itself is a basic integrity check exercising all libthread_db
functions used by GDB on GNU/Linux systems.  By extension this also
exercises the proc_service functions provided by GDB that libthread_db
uses.

This functionality is useful for NPTL developers and libthread_db
developers.  It could also prove useful investigating bugs reported
against GDB where the thread debugging library or GDB's proc_service
layer is suspect.

gdb/ChangeLog:

* linux-thread-db.c (valprint.h): New include.
(struct check_thread_db_info): New structure.
(check_thread_db_on_load, tdb_testinfo): New static globals.
(check_thread_db, check_thread_db_callback): New functions.
(try_thread_db_load_1): Run integrity checks if requested.
(maintenance_check_libthread_db): New function.
(_initialize_thread_db): Register "maint check libthread-db"
and "maint set/show check-libthread-db".
* NEWS: Mention the above new commands.

gdb/doc/ChangeLog:

* gdb.texinfo (Maintenance Commands): Document "maint check
libthread-db" and "maint set/show check-libthread-db".

gdb/testsuite/ChangeLog:

* gdb.threads/check-libthread-db.exp: New file.
* gdb.threads/check-libthread-db.c: Likewise.
gdb/ChangeLog
gdb/NEWS
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo
gdb/linux-thread-db.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.threads/check-libthread-db.c [new file with mode: 0644]
gdb/testsuite/gdb.threads/check-libthread-db.exp [new file with mode: 0644]