From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta038.useast.a.cloudfilter.net (omta038.useast.a.cloudfilter.net [44.202.169.37]) by sourceware.org (Postfix) with ESMTPS id 3D7D33858C29 for ; Wed, 17 Jan 2024 18:59:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3D7D33858C29 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 3D7D33858C29 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=44.202.169.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705517948; cv=none; b=M8kZJXWMhPXG4SWwfd0Tc3lGriwpXA2GzC2BrnLylM4xPQD/mOwrb/PTx6J+KpN3nsAQeHS2vH89jS+VN0U4zCgd8G8nhi6S0yi0eD6ZsnUhPRsvOuqXe+EORmoKJ98pk8zP1ZBhUIsqJJ0qao2DbVIkurl34PXwXj1skgGd6qA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705517948; c=relaxed/simple; bh=eOb9ju1ueAm7O5fsk/IM3dyg0PkuIOo9vfolQNzTZyw=; h=DKIM-Signature:From:Date:Subject:MIME-Version:Message-Id:To; b=WZNmGWfiZjQYbkpv6Ql124D+c6bl5NoyJZubuiqCg4pn4vnfTo/bb3TQTnCEJfB8fFQWY/WZnhOhGCaDtCB+h7/fG+9KfdWuDdS77seW2Qvrno7SBCtk+h9iTEorMs02IrVrOAJ41urCQABLRK2W2ITvAiQOYvrE6JUbV1GH18s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6009a.ext.cloudfilter.net ([10.0.30.184]) by cmsmtp with ESMTPS id Q8KirIoYc9gG6QB7urT1sv; Wed, 17 Jan 2024 18:59:03 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id QB7uraSTIjqQkQB7urdrcr; Wed, 17 Jan 2024 18:59:02 +0000 X-Authority-Analysis: v=2.4 cv=A7F/goaG c=1 sm=1 tr=0 ts=65a82376 a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=IkcTkHD0fZMA:10 a=dEuoMetlWLkA:10 a=Qbun_eYptAEA:10 a=CCpqsmhAAAAA:8 a=mDV3o1hIAAAA:8 a=FynSyykwWHE-Aet8Js8A:9 a=QEXdDO2ut3YA:10 a=ul9cdbp4aOFLsgKbc677:22 a=_FVE-zBwftR9WsbkzFJk:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Cc:To:In-Reply-To:References:Message-Id: Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date:From:Sender: Reply-To: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=V/JY53WNHTJwdloozXtOWAWTmIFTovQ4XtlWqxPdZ2A=; b=czZ/0vojWsIWKrXQVRn+pgzWd6 bvPCuNPII7iRNn/RH7K3q2hC1zdbCQqHbSkiY8mNdwZhFJhWolscHyknBAu1lIxzlsOceGqskJX+w a1ej96estwl6MHw68fES+9la0; Received: from 97-122-68-157.hlrn.qwest.net ([97.122.68.157]:45122 helo=[192.168.0.21]) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1rQB7t-004FFp-2i; Wed, 17 Jan 2024 11:59:01 -0700 From: Tom Tromey Date: Wed, 17 Jan 2024 11:58:53 -0700 Subject: [PATCH gdb/testsuite 6/7] Add gdb.dwarf2/forward-spec-inter-cu.exp MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240117-die-map-madness-v1-6-42fb435ad1ed@tromey.com> References: <20240117-die-map-madness-v1-0-42fb435ad1ed@tromey.com> In-Reply-To: <20240117-die-map-madness-v1-0-42fb435ad1ed@tromey.com> To: gdb-patches@sourceware.org Cc: Tom de Vries 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: 97.122.68.157 X-Source-L: No X-Exim-ID: 1rQB7t-004FFp-2i X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-68-157.hlrn.qwest.net ([192.168.0.21]) [97.122.68.157]:45122 X-Source-Auth: tom+tromey.com X-Email-Count: 10 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfCkUwT2ZfGlFGs8EzspkX3vsqwCN9EzP9plH5WharFqlTX2p6mUcx0R3OpgqONBES7+eILeMtkyOwLCMyhFQjcudpwXQNGMnHDEOMRFSomBmIUF9h/a2 rcd0inUcbnLX5n39NhipTYFhWDHnWf1AhgzNkTaCrH3h9RaDpW0ZVTW3jJ6QLnT9qfTMsDAjBtrUNGTryzPAVIXVFab3STaqtWI= X-Spam-Status: No, score=-3022.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_SHORT,RCVD_IN_DNSWL_NONE,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 List-Id: From: Tom de Vries Add a regression test for PR symtab/30846. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30846 --- gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp | 103 +++++++++++++++++++++ 1 file changed, 103 insertions(+) diff --git a/gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp b/gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp new file mode 100644 index 00000000000..d8367b0a162 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp @@ -0,0 +1,103 @@ +# Copyright 2023 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Check that the DWARF reader works with a a DW_AT_specification that +# refers to a later DIE. Inter-cu variant of forward-spec.exp. + +load_lib dwarf.exp + +# This test can only be run on targets which support DWARF-2 and use gas. +require dwarf2_support + +standard_testfile main.c -debug.S + +# Set up the DWARF for the test. +set asm_file [standard_output_file $srcfile2] +Dwarf::assemble $asm_file { + global srcfile + + declare_labels spec + + cu {} { + DW_TAG_compile_unit { + {DW_AT_language @DW_LANG_C_plus_plus} + } { + # The new indexer has special code to compute the full + # name of an object that uses a specification that appears + # later in the DWARF. + DW_TAG_variable { + {DW_AT_specification %$spec} + {DW_AT_location { + DW_OP_const1u 23 + DW_OP_stack_value + } SPECIAL_expr} + } + } + } + + cu {} { + DW_TAG_compile_unit { + {DW_AT_language @DW_LANG_C_plus_plus} + } { + declare_labels myint + + myint: DW_TAG_base_type { + {DW_AT_byte_size 4 DW_FORM_sdata} + {DW_AT_encoding @DW_ATE_signed} + {DW_AT_name myint} + } + + DW_TAG_namespace { + {DW_AT_name ns} + } { + spec: DW_TAG_variable { + {DW_AT_name v} + {DW_AT_type :$myint} + {DW_AT_declaration 1 DW_FORM_flag_present} + } + } + } + } +} + +if {[build_executable "failed to build executable" ${testfile} \ + [list $srcfile $asm_file] {nodebug}]} { + return -1 +} + +set eol "\r\n" +set ws "\[ \t\]" + +set worker_threads_list {} + +# Exercises the intra-shard case. +lappend worker_threads_list 0 + +# Might exercise the inter-shard case. +lappend worker_threads_list default + +foreach_with_prefix worker_threads $worker_threads_list { + + clean_restart + + if { $worker_threads != "default" } { + gdb_test_no_output "maint set worker-threads $worker_threads" + } + + gdb_load $binfile + + gdb_test "maint print objfiles" "$eol$ws+qualified:$ws+ns::v$eol.*" \ + "v has parent ns" +} -- 2.43.0