From patchwork Sun Dec 10 16:45:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 81822 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 35B003857C6B for ; Sun, 10 Dec 2023 16:46:22 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from omta34.uswest2.a.cloudfilter.net (omta34.uswest2.a.cloudfilter.net [35.89.44.33]) by sourceware.org (Postfix) with ESMTPS id 3D02F3858283 for ; Sun, 10 Dec 2023 16:45:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3D02F3858283 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3D02F3858283 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702226709; cv=none; b=Ww/kp0ZlsRgPuIDsQgqDRWhcig74Dh1NRVhwdY+UJzry+JRX/5cOt/I9uHq9oGkJVJiK5FPP4yx5UB5vVsSC9zHHrjCc3yHFRfQThFs4NLjzMoXBm3Ond/GlQKRW4OzMbM7sYXxqzxx4sh62UORJ77lmbhzh2Tt2LQhrqOZ8tEo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702226709; c=relaxed/simple; bh=eK57J5oXC2CwJkhTN6QUMfAOmhcQ8dRDG0u8DgruEXU=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=eubSJ0BF1l/QOvJ42EPuRLM0VXdJZLDsx5f8dBblNiTA1sJCH7Ch3eddP5Uhd9sGQvBZOivXcWYP5JfGAbe9umhdPf4Aqaqy/E5WlZICZuke2ux6w0UVZSTxmnxyynWbfCUSdyLvKEakHELFO0y8g6bgnoOAptI6P1zWePpFdlc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6006a.ext.cloudfilter.net ([10.0.30.182]) by cmsmtp with ESMTPS id CIOor4dRp8HteCMvRr8csH; Sun, 10 Dec 2023 16:45:05 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id CMvQrVWdHGKIcCMvRrYj6H; Sun, 10 Dec 2023 16:45:05 +0000 X-Authority-Analysis: v=2.4 cv=E+beGIRl c=1 sm=1 tr=0 ts=6575eb11 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=e2cXIFwxEfEA:10 a=Qbun_eYptAEA:10 a=V4CZaGjAyCegSSiQRA8A:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=To:In-Reply-To:References:Message-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:Subject:Date:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=mlTR8eoNlek7IddDKCSPL3v2JziVQTSOkVeQmYwPXTg=; b=ktdrSECu72Uxza7foNM7qOSyXd tMBnggjeQhghLurHtvzHfRRsB4k4bXqNMuhEPhXlIfVvQWnOz8tt9ckl/z4HMLqAerdNpr8Rwmgd+ D9tUbgTh21PHsNnoIy6sw2/Mk; Received: from [198.59.47.65] (port=52394 helo=[192.168.131.83]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rCMvQ-001rpu-1k for gdb-patches@sourceware.org; Sun, 10 Dec 2023 09:45:04 -0700 From: Tom Tromey Date: Sun, 10 Dec 2023 09:45:02 -0700 Subject: [PATCH 13/17] Explicitly expand CUs in dw2-inline-with-lexical-scope.exp MIME-Version: 1.0 Message-Id: <20231210-debug-names-fix-v1-13-a8f6d2525018@tromey.com> References: <20231210-debug-names-fix-v1-0-a8f6d2525018@tromey.com> In-Reply-To: <20231210-debug-names-fix-v1-0-a8f6d2525018@tromey.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.4 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 198.59.47.65 X-Source-L: No X-Exim-ID: 1rCMvQ-001rpu-1k X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([192.168.131.83]) [198.59.47.65]:52394 X-Source-Auth: tom+tromey.com X-Email-Count: 14 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfJw+bshDQT4Df9APuJnmfM1WY0R109aPPDfV8Hg7EksSpUtOAqh5NeeyptdjX7NAArj2V5NZr+hvGyrY8Iprj9aarLS/N/GY0KhuuqzeuRHoyP54Zlgz DXWiXxw0jUfRb3dmLWa8rtV+nx77TtsW7DEQfdUhOjVo7hL1Z+G3T/701Dk3nqHs0CxbKTiAssXiCcJAPe1ykp72fq5ek3FXfpY= X-Spam-Status: No, score=-3024.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org dw2-inline-with-lexical-scope.exp relies on the main CU being expanded. However, it doesn't guarantee that this actually happens, and with the new .debug_names reader, it won't, because the "main" program will be found in the index without requiring CU expansion. This patch fixes the problem by explicitly expanding the CU in question. Note that this is an artificial bug -- it occurs because the generated .debug_aranges isn't correct. --- gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp b/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp index fb1c5605e9b..d62d06b43c5 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-inline-with-lexical-scope.exp @@ -133,5 +133,9 @@ if {[prepare_for_testing "failed to prepare" ${testfile} \ runto breakpoint_label +# When using cc-with-debug-names, nothing will force the CU to be +# expanded. Do it manually. +gdb_test_no_output "maint expand-symtabs [file tail $srcfile]" + # Bad GDB was printing an additional "value = ". gdb_test "info locals" "value = 42\r\nnum = 42"