selftest/gdb_backtrace: avoid printing backtrace twice with 1 thread
commit12ce289922ca594384ffb9e035fcd9815e2aa331
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 7 Mar 2024 10:13:56 +0000 (7 23:13 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 20 Mar 2024 23:42:34 +0000 (20 23:42 +0000)
treec20121fad3d0094c1fc55a6d50689c0618713ff5
parent904479cdf6d58142baa012a7b588fca857f275f4
selftest/gdb_backtrace: avoid printing backtrace twice with 1 thread

We call 'thread apply all bt full' in case there are interesting
things going on in other threads, but often there are no other threads
and it only serves to repeat the original trace (and very slowly, for
some reason).

The $_inferior_thread_count convenience variable is new in gdb 13.1
(2022-ish) so we init-if-undefined it to default to the old behaviour.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
selftest/gdb_backtrace