selftest/gdb_backtrace: print python traceback if available
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 7 Mar 2024 09:30:24 +0000 (22:30 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 20 Mar 2024 23:42:34 +0000 (23:42 +0000)
commit904479cdf6d58142baa012a7b588fca857f275f4
treea639c23e0ac161c09ce7e98fbfb04fcb4da23f25
parentda500249fcf52629c8d3da4d608b85b96b43cca6
selftest/gdb_backtrace: print python traceback if available

If a program happens to have 'PyList_New' defined but is not a python
script, gdb will print

> Undefined command: "py-bt".  Try "help".

and probably stop. This happens after the C backtraces have been
printed, so nothing is lost.

The traceback is printed twice -- once in conventional Python style
for clarity, and once with extra "full" information.

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