From patchwork Fri Mar 3 17:50:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 64016 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp544477wrd; Fri, 3 Mar 2023 09:51:15 -0800 (PST) X-Google-Smtp-Source: AK7set+4SP8v6EnxP8mxZCcQKruzzwZBGfyN8ZP6hMEVCs/4NfyVUFUloyp5CZicEdeE4K7v4mgx X-Received: by 2002:aa7:d90d:0:b0:4af:70a6:5b06 with SMTP id a13-20020aa7d90d000000b004af70a65b06mr2673556edr.27.1677865875540; Fri, 03 Mar 2023 09:51:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677865875; cv=none; d=google.com; s=arc-20160816; b=B1IlneESiBeXDHpQxnCI2ldds7ojKt7XXAmvjL0kJBl3ORMrKCPNta690JjVAWsEH7 9IjC9cpD7CCRkuHN1MmVF8y3CFlLkbWAA2+sjpz5MPCanb9N/79klXFbS6QXloAlnZeJ z1lzpMajvD01k4WJzjzXzFbaP+HwVRjWcva6RL2qAr5XWUjpVw68FWDGlA5kdoES0bch 5X82Lz1OUG3+hoB3OGLRtByXGSgVoTWAVmNc53KRycuxC14caXnJteDONcbS372n3SgN KSUyGgew5OnyuDdCkTD/sOowjl4C5Q7NJoft8NtSwEKtVkh0tQoJrsd06j1gKnhJ8aUH v92w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:mime-version :user-agent:message-id:date:organization:subject:cc:to:dmarc-filter :delivered-to:dkim-signature:dkim-filter; bh=8O/TDp9N5TBggnY71pPDlfk9LwAKTAhwIZxPn+12jWk=; b=Eh7myvA7TB4mlGQCOXfO+r6zGumYPEICpMeKzigfBYnAJQgQ4RyBegUwp3GyKG3V2D K93q9DRPRCXp1GO5rCJ8exULvx3dUgldW9oiJu6m0B/1+Nu7l1C1Q8OIn9HLiAaLiTPa U0GjcEJXl6vqwT+FXJBcuR4tegi3Pjftzyeym4gLhmWQl5ktrq5W2Mtuw6YxykWhu/t2 sxQ+PHByO3y84a16CSuycPFHRjBza6t2+mXV6RwKF+m8nhLzDSKZo/KRONOXD7+VFRDf rheErAcI1br0wz+xpXyWHLmuMJLTXv2BTXQfcquNVDcbr3rcDew9FCqj//dDZmlWlnyI f9sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ky7LLvOF; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id l14-20020aa7c3ce000000b004af5f4e5276si2950294edr.569.2023.03.03.09.51.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Mar 2023 09:51:15 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ky7LLvOF; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5AB5D3851C04 for ; Fri, 3 Mar 2023 17:50:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5AB5D3851C04 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1677865859; bh=8O/TDp9N5TBggnY71pPDlfk9LwAKTAhwIZxPn+12jWk=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=ky7LLvOFJUY2agpU5xkoR0a+HnXgL60MiU0JgFCb34sFMndDxTnuS55xU+3xebnrZ udOs1OsU61nX0z8EJY7xtdcxc30f2+156fTNFP+MqZz8GfU6R5qevjSBMU2nzhoifW 40f8P51oTjaPLAVUjCRV1ydBlUIMxyvfbIRqG70E= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from rock.gnat.com (rock.gnat.com [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTPS id 1B6773858D37; Fri, 3 Mar 2023 17:50:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B6773858D37 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id DB60111659D; Fri, 3 Mar 2023 12:50:14 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id x1p+9BsmESJ6; Fri, 3 Mar 2023 12:50:14 -0500 (EST) Received: from free.home (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPS id A14A0116598; Fri, 3 Mar 2023 12:50:14 -0500 (EST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 323Ho74a606305 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 3 Mar 2023 14:50:07 -0300 To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Cc: tromey@adacore.com Subject: [PATCH] [libstdc++] [prettyprint] add local std::string use to more tests Organization: Free thinker, does not speak for AdaCore Date: Fri, 03 Mar 2023 14:50:07 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Alexandre Oliva via Gcc-patches From: Alexandre Oliva Reply-To: Alexandre Oliva Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759369888683312428?= X-GMAIL-MSGID: =?utf-8?q?1759369888683312428?= We're getting regressions after ugprading to GDB 13 in a few of the libstdc++ pretty-printing tests. It might seem like a GDB regression, but that update has a new symbol reader, and Tom Tromey says it exposes a latent problem in the pretty-printer, namely, when a name is not defined locally in the local translation unit, GDB will look for it in other units, and if multiple different definitions are available, there are no guarantees as to which one it will find. Since libstdc++ contains units in which std::string maps to different types, in order to ensure the tests get the std::string definition we expect, we need std::string to be present in the debug information for the test itself, as we already do in other tests. Regstrapped on x86_64-linux-gnu. Ok to install? for libstdc++-v3/ChangeLog * testsuite/libstdc++-pretty-printers/80276.cc: Add std::string to debug info. * testsuite/libstdc++-pretty-printers/libfundts.cc: Likewise. Change-Id: I928617d44679c63d634c26f6db17d7580a9bcd8f TN: W223-034 --- .../testsuite/libstdc++-prettyprinters/80276.cc | 5 +++++ .../libstdc++-prettyprinters/libfundts.cc | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc index db4de593808e3..1d6b0207106a6 100644 --- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc +++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc @@ -36,6 +36,11 @@ int main() { using namespace std; + // Ensure debug info for std::string is issued in the local + // translation unit, so that GDB won't pick up any alternate + // std::string notion that might be present in libstdc++.so. + string bah = "hi"; + (void)bah; unique_ptr*>>> p1; unique_ptr*>>[]> p2; unique_ptr*>>[10]> p3; diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc index b1c91033cc8e6..29e8bc8f194e3 100644 --- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc +++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc @@ -32,6 +32,12 @@ using std::experimental::string_view; int main() { + // Ensure debug info for std::string is issued in the local + // translation unit, so that GDB won't pick up any alternate + // std::string notion that might be present in libstdc++.so. + std::string bah = "hi"; + (void)bah; + string_view str = "string"; // { dg-final { note-test str "\"string\"" } }