From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 167573858430; Thu, 29 Jun 2023 13:23:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 167573858430 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688044993; bh=qh/dNoxOJ79zkjlQuGxmNYkt9Ge3s/pRJSCTEypgeTE=; h=From:To:Subject:Date:From; b=OLhRoeqxZa338a/5r+GW8k+kUz6srjM0xxZnD7ngLyKWn1vxjmX/OoZWQsEB4eSOS ozJkdipHd18NLY3h8LfP8KPbD5Lap0VbW5dnYJjv/Twjhl+Rdfs76fUBxDeWC2gDB1 Gnib5LA4VA4GLJbKMcGEt9kI7VtUBH1a0FdeF4xY= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Tom Tromey To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-2189] Relax type-printer regexp in libstdc++ test suite X-Act-Checkin: gcc X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: 16e4f09a594f801f68eb0a3e35d1c6e60d402b64 X-Git-Newrev: c7ed2ccd590d9c0d0146f61c97ca6500910936b8 Message-Id: <20230629132313.167573858430@sourceware.org> Date: Thu, 29 Jun 2023 13:23:13 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c7ed2ccd590d9c0d0146f61c97ca6500910936b8 commit r14-2189-gc7ed2ccd590d9c0d0146f61c97ca6500910936b8 Author: Tom Tromey Date: Thu Jun 22 07:35:02 2023 -0600 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. Diff: --- libstdc++-v3/testsuite/lib/gdb-test.exp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/testsuite/lib/gdb-test.exp b/libstdc++-v3/testsuite/lib/gdb-test.exp index 3728a060aa4..d8e572ef7b3 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" }