aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2023-06-22 07:35:02 -0600
committerTom Tromey <tromey@adacore.com>2023-06-29 07:10:04 -0600
commitc7ed2ccd590d9c0d0146f61c97ca6500910936b8 (patch)
treedae9b8db19e94bd1a8df517b782677351e5b8988
parent16e4f09a594f801f68eb0a3e35d1c6e60d402b64 (diff)
downloadgcc-c7ed2ccd590d9c0d0146f61c97ca6500910936b8.zip
gcc-c7ed2ccd590d9c0d0146f61c97ca6500910936b8.tar.gz
gcc-c7ed2ccd590d9c0d0146f61c97ca6500910936b8.tar.bz2
Relax type-printer regexp in libstdc++ test suite
The libstdc++ test suite checks whether gdb type printers are available like so: set do_whatis_tests [gdb_batch_check "python print(gdb.type_printers)" \ "\\\[\\\]"] This regexp assumes that the list of printers is empty. However, sometimes it's convenient to ship a gdb that comes with some default printers, causing this to erroneously report that gdb is "too old". I believe the intent of this check is to ensure that gdb.type_printers exists -- not to check its starting value. This patch changes the check to accept any Python list as output. Note that the patch doesn't look for the trailing "]". I tried this but in my case the output was too long for expect. It seemed fine to just check the start, as the point really is to reject the case where the command prints an error message. libstdc++-v3/ChangeLog * testsuite/lib/gdb-test.exp (gdb-test): Relax type-printer regexp.
-rw-r--r--libstdc++-v3/testsuite/lib/gdb-test.exp6
1 files changed, 5 insertions, 1 deletions
diff --git a/libstdc++-v3/testsuite/lib/gdb-test.exp b/libstdc++-v3/testsuite/lib/gdb-test.exp
index 3728a06..d8e572e 100644
--- a/libstdc++-v3/testsuite/lib/gdb-test.exp
+++ b/libstdc++-v3/testsuite/lib/gdb-test.exp
@@ -107,8 +107,12 @@ proc gdb-test { marker {selector {}} {load_xmethods 0} } {
}
}
+ # A very old version of gdb will not have the type_printers
+ # global. Some organizations may ship a gdb that has some default
+ # type printers, so accept any list output as indication that the
+ # global exists.
set do_whatis_tests [gdb_batch_check "python print(gdb.type_printers)" \
- "\\\[\\\]"]
+ "\\\[.+"]
if {!$do_whatis_tests} {
send_log "skipping 'whatis' tests - gdb too old"
}