[libcxx][pretty printers] Check GDB Python scripting support
authorDavid Spickett <david.spickett@linaro.org>
Thu, 23 Sep 2021 13:28:24 +0000 (13:28 +0000)
committerDavid Spickett <david.spickett@linaro.org>
Fri, 24 Sep 2021 08:32:11 +0000 (08:32 +0000)
commit0a36c72dee61a0a97805a3cd297572ad0c38d979
tree63c87cad2365cd2605c82090b4d00572003bc654
parentea92283449f9b132531ef152625e3e799395e449
[libcxx][pretty printers] Check GDB Python scripting support

I found this after upgrading from Ubuntu bionic (gdb 8.1.1) to
Focal (gdb 9.2). (where this test fails, but that's for a
different patch)

9.2 allows you to set breakpoint commands from
Python, which was added in 8.3.
(bintutils a913fffbdee21fdd50e8de0596358be425775678
"Allow breakpoint commands to be set from Python")

The reason this test never failed before was because it did so
silently. "source <python file>" doesn't fail even if that script
raises an Exception.

To fix this extend the gdb lit feature to check that:
* gdb exists
* has Python support
* allows you to set breakpoint commands

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D110334
libcxx/test/libcxx/gdb/gdb_pretty_printer_test.sh.cpp
libcxx/utils/libcxx/test/features.py