]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/testsuite: add test for backtracing for threaded inferiors from a corefile
authorGuinevere Larsen <blarsen@redhat.com>
Thu, 24 Aug 2023 09:00:35 +0000 (11:00 +0200)
committerGuinevere Larsen <blarsen@redhat.com>
Wed, 24 Jan 2024 12:53:34 +0000 (13:53 +0100)
commit8669a8b67408c11d6bf77a09c6aa733f7150abed
tree260973c542c45fc8b3fbf8ef4a5b06c0559be1ef
parentf895041bb9c6b05ddb457ce24fd8cb33880fe375
gdb/testsuite: add test for backtracing for threaded inferiors from a corefile

This patch is based on an out-of-tree patch that fedora has been
carrying for a while. It tests if GDB is able to properly unwind a
threaded program in the following situations:
* regular threads
* in a signal handler
* in a signal handler executing on an alternate stack

And the final frame can either be in a syscall or in an infinite loop.

The test works by running the inferior until a crash to generate a
corefile, or until right before the crash. Then applies a backtrace to
all threads to see if any frame can't be identified, and the order of
the threads in GDB. Finally, it goes thread by thread and tries to
collect a large part of the backtrace, to confirm that everything is
being unwound correctly.

Co-Authored-By: Andrew Burgess <aburgess@redhat.com>
Reviewed-By: Luis Machado <luis.machado@arm.com>
Approved-By: Luis Machado <luis.machado@arm.com>
gdb/testsuite/gdb.threads/threadcrash.c [new file with mode: 0644]
gdb/testsuite/gdb.threads/threadcrash.exp [new file with mode: 0644]