From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2RSPM9dlqGmERxQAWB0awg (envelope-from ) for ; Wed, 04 Mar 2026 12:03:19 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=labware.com header.i=@labware.com header.a=rsa-sha256 header.s=mimecast20220511 header.b=nBCW8t69; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id CC6071E0DD; Wed, 04 Mar 2026 12:03:19 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2C5171E089 for ; Wed, 04 Mar 2026 12:03:19 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id BB4864BA23F1 for ; Wed, 4 Mar 2026 17:03:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB4864BA23F1 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=labware.com header.i=@labware.com header.a=rsa-sha256 header.s=mimecast20220511 header.b=nBCW8t69 Received: from us-smtp-delivery-114.mimecast.com (us-smtp-delivery-114.mimecast.com [170.10.133.114]) by sourceware.org (Postfix) with ESMTP id 27F044BA23C6 for ; Wed, 4 Mar 2026 17:00:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 27F044BA23C6 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=labware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=labware.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 27F044BA23C6 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.114 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772643617; cv=none; b=S8LvjTnnKUF+oafBsbF0rpPOE+LWCGQrt2TjDQIqAdRsoEMzIznq0ZnORtPYx8WNboNJOjXxCHbY/hxUrTuSt4lzROdQBntmgH+ZbJ+uF9eTjBoLDaatixLcVMzUr0MQII97LY5kiCKR9E1+gsA+DbrPcSfEj7k04DfPUxQFB40= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1772643617; c=relaxed/simple; bh=NzJYrpBjRyfGNvJOjXUC3xNxwB8lqs2Y4Jf75rCGUXg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=PWv3vf2QRu3EyttePSoAd7ylZwGv/olNoMqzn4BhVYFu7ENfOzsJn/8Ma9qk2dpz+RbgZBc7z/n7R0u3ZXphw6vrYY+gUqTCgOKZ8dmB4XYb2QFVnQyAtGQv8t49ANCNFgTy+7NIkiTdJxl3jh8QLru3mGVHjyRrkE2gedAfDjA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 27F044BA23C6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=labware.com; s=mimecast20220511; t=1772643616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RhWLMWzOdH130+WaYZC6Xn5GpbvpPPEndWNmvVtLxrQ=; b=nBCW8t69mpEczwSgXSPNUhmpMl+cgAncaBjo8ef/pM3I9iCE0sP9IQanBWTX632qyGCubG 0ZKEognNf1RnoNaMffsYc0h7kjyXI3OV/DKQMKu69kpCcqFOq/Qbccwqu3HuTCE+MwRV5j DY1xvayQP+pSomLM8X7a4TEvm3ImDqQ= Received: from BL2PR02CU003.outbound.protection.outlook.com (mail-eastusazon11021104.outbound.protection.outlook.com [52.101.52.104]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-582-UteuYP8OMvOUDBaACyl1Ww-1; Wed, 04 Mar 2026 12:00:15 -0500 X-MC-Unique: UteuYP8OMvOUDBaACyl1Ww-1 X-Mimecast-MFC-AGG-ID: UteuYP8OMvOUDBaACyl1Ww_1772643615 Received: from SA1PR17MB5365.namprd17.prod.outlook.com (2603:10b6:806:1d8::11) by IA3PR17MB7264.namprd17.prod.outlook.com (2603:10b6:208:51c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9654.22; Wed, 4 Mar 2026 17:00:14 +0000 Received: from SA1PR17MB5365.namprd17.prod.outlook.com ([fe80::9a:538a:fa42:730e]) by SA1PR17MB5365.namprd17.prod.outlook.com ([fe80::9a:538a:fa42:730e%3]) with mapi id 15.20.9654.022; Wed, 4 Mar 2026 17:00:14 +0000 From: Jan Vrany To: gdb-patches@sourceware.org CC: Jan Vrany Subject: [PATCH v2 5/7] gdb: do not set blockvector address map Date: Wed, 4 Mar 2026 16:59:12 +0000 Message-ID: <20260304165914.3209106-6-jan.vrany@labware.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260304165914.3209106-1-jan.vrany@labware.com> References: <20260304165914.3209106-1-jan.vrany@labware.com> X-ClientProxiedBy: LO4P265CA0168.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:312::11) To SA1PR17MB5365.namprd17.prod.outlook.com (2603:10b6:806:1d8::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA1PR17MB5365:EE_|IA3PR17MB7264:EE_ X-MS-Office365-Filtering-Correlation-Id: 078c3486-974f-4447-79f1-08de7a0f8110 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014 X-Microsoft-Antispam-Message-Info: capxnuO9os5rPUTN067ZXGEHbQeOzLf4zY0T8Scy7yhMyax9NsavFo3Axy5E3NoXTLWAFkESmypWAqnQtfpokQVCgM+qEux775wkngGrnk6VI3iQ7Q5MoW6f6sraSWPrc2GYFS7SaM1V5tav4mQWQ2NqiSK2lDUNNTxoRZhz2MF6WQtU6G8pzlsjJ6yqQkV1MEw9ihWmW/SaQ8b6kLvY38m2iC6aDmGo7SwA3g9E9TR14ESax9cxeP3hPajk4txh7NDXtyXxfVAhbSOlmpyv6OklXP3XmG3AyN2nbGcgJnMVHDGFDtnHIFystY9txD35xKJ/gKvM+VeNsWQO4kEBRYOC/f6loSwlB8yrrEhYW/seBAIf2LtPKgHMuM4owhf0P28fCXzZdgdh0+HeQqTjE5rmpm8iBWCjoM8ROGmv7ONp2JPmj9FXVpsWoI0SXS94kY7n4/8Vhd2e3SB2Kzq9SF1jpWbbYEfoiraTLCevokgFqpHAs/lJyAHYTkHSSDc0Duh3M4rkDHRVBZP4SdNihKZeZlmVcMZA9LCyhXEbyYjmUF6IVI3jwWQ1JGpLt1dLhpPvIUOgFmxLSl+bO+kfyNxlUX8eedgDC53ZIPnvM3sgJF678Jh8IM/z9IHkgO6haqXQgs7AVRLz8ebgs/bLzlOd7nNNPzKX6gVPVqEQOcpE3ivW7lVlGwvsnumc/3YJ5HLTgSbHAR+QyX8H6C0+Y5bfJ7Wh4MLYd9M8oocyoA4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA1PR17MB5365.namprd17.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014); DIR:OUT; SFP:1102 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?ettLQ24dVN4V4httQMnq4kBLUSh0X+u9gvJYq7exJXl/ryCNzOBiODCFJwZR?= =?us-ascii?Q?mHRb9jrGyKElEX48n4LCgcR6uylxFkcXgfXYT+sXHEnjw1AtJPwK2DCjO1jz?= =?us-ascii?Q?gHgeFnrAD/Ff92+W+6rpNO/56r1lhIZ1N4Ca5+NNMV1zDhgoq8+pTN4fu8RA?= =?us-ascii?Q?I9/Uz4orXXPhgnzInIC2ddZeU3cz+HACFZodNQbu/sTNbXOHlrfpRzMGEttc?= =?us-ascii?Q?yxXG+HzosLVC93ZkSB+Qak2iIxwqy9KpeDswaF4DNVl834Zi177nyMCnAVXT?= =?us-ascii?Q?8MRfzCr+RmMXzPPqsjnMGR+icQT5hOpsKt90zaqh7NAR9UdvWfkKGXoSI4bz?= =?us-ascii?Q?71TxkTaneerrUBQb7FcXdjUDqMYLqjdXxfiuvEM2auO6mAwdjOUISBvt5h36?= =?us-ascii?Q?R1eVBHCeRJJOsl+ECSo4jD9/Wn/3vUE/KiOoU3J4vAOqeBj5swzUAsEJLegc?= =?us-ascii?Q?MZUe8ylB+OVfIozl0XHXA3khTFLhwMNEcKU2ESez1z/xQVtBOY3g5d253/9K?= =?us-ascii?Q?GReiw89PVHw5JzbRlVEfv2etI04wNEXstlyk8RdKsVWgpJR5/9InaRhB10Q6?= =?us-ascii?Q?av2E7s6aX1248cUHukVaiFyuYzKEHkRJ/Jy8piRpWXmzFn/oryGtCzll9SqK?= =?us-ascii?Q?1Ns5pypaBHDiGwvX/tLB7YU0dVRkFji+lJySAlbdGGn5UY27psqVCvUJ2UG0?= =?us-ascii?Q?5o6fUFEnYC/AmMhsUFAkkTLTrCXLSGv6fiwMCLLqZXnTFo8p30kK5QseMGfb?= =?us-ascii?Q?qqW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?= =?us-ascii?Q?KH8gHtcZUNTOCGW+4PDfM6/FDlLqirNPfWrONIu+XtvddBEXZY+DoJV08jsF?= =?us-ascii?Q?dndJm4b/vw=3D=3D?= X-OriginatorOrg: labware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 078c3486-974f-4447-79f1-08de7a0f8110 X-MS-Exchange-CrossTenant-AuthSource: SA1PR17MB5365.namprd17.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2026 17:00:14.2754 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b5db0322-1aa0-4c0a-859c-ad0f96966f4c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uSmDfPPfl1LBgiFN79O70V5I0S2O6ZCGh4RlpS9AKJaD9H1gt5ZWZPfa0uhFhTeSb6j0V5V4YjGT2e13ZSp6Ig== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA3PR17MB7264 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: AydR4UwCqZihPun3ZzlbdWoR2Oj_KYjBehi1gs3X8uM_1772643615 X-Mimecast-Originator: labware.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=WINDOWS-1252 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~public-inbox=simark.ca@sourceware.org This commit removes the code that sets blockvector's addrmap in case one or more blocks are non-contiguous. Following commit will fix GDB to handle such blocks without use of the addrmap. Testing on Debian x86_64 using with and without -readnow, I see no new regressions except following: FAIL: gdb.dwarf2/debug-names.exp: print _start This is caused by discrepancy between the debug info and the debug names and will be eventually fixed in a separate patch. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D33829 --- gdb/buildsym.c | 55 ++------------------------------------------------ 1 file changed, 2 insertions(+), 53 deletions(-) diff --git a/gdb/buildsym.c b/gdb/buildsym.c index aa95889424b..5f47d0d5835 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -316,18 +316,10 @@ buildsym_compunit::make_blockvector () std::unique_ptr blockvector; int i; =20 - /* Count the length of the list of blocks. Also, if any blocks are - non-contiguous then we need to make use of the addrmap for mapping - addresses to blocks (PENDING_ADDRMAP_INTERESTING is set to true). If - all the blocks are contiguous then we can avoid creating the addrmap, - and perform block look up using the blockvector. */ + /* Count the length of the list of blocks. */ =20 - bool pending_addrmap_interesting =3D false; for (next =3D m_pending_blocks, i =3D 0; next; next =3D next->next, i++) - { - if (!next->block->is_contiguous ()) -=09pending_addrmap_interesting =3D true; - } + ; =20 blockvector =3D std::make_unique (i); =20 @@ -345,49 +337,6 @@ buildsym_compunit::make_blockvector () m_pending_block_obstack.clear (); m_pending_blocks =3D nullptr; =20 - /* If we needed an address map for this symtab, record it in the - blockvector. */ - if (pending_addrmap_interesting) - { - struct addrmap_mutable pending_addrmap; - int num_blocks =3D blockvector->num_blocks (); - - /* If PENDING_ADDRMAP_INTERESTING is true then we must have seen -=09 an interesting block. If we see one block, then we should at a -=09 minimum have a global block, and a static block. */ - gdb_assert (num_blocks > 1); - - /* Assert our understanding of how the blocks are laid out. */ - gdb_assert (blockvector->block (0)->is_global_block ()); - gdb_assert (blockvector->block (1)->is_static_block ()); - - /* The 'J > 1' here is so that we don't place the global block into -=09 the map. For CU with gaps, the static block will reflect the -=09 gaps, while the global block will just reflect the full extent of -=09 the range. */ - for (int j =3D num_blocks; j > 1; ) -=09{ -=09 --j; -=09 struct block *b =3D blockvector->block (j); - -=09 gdb_assert (!b->is_global_block ()); - -=09 if (b->is_contiguous ()) -=09 pending_addrmap.set_empty (b->start (), (b->end () - 1), b); -=09 else -=09 { -=09 for (const auto &br : b->ranges ()) -=09=09pending_addrmap.set_empty (br.start (), (br.end () - 1), b); -=09 } -=09} - - blockvector->set_map -=09(new (&m_objfile->objfile_obstack) addrmap_fixed -=09 (&m_objfile->objfile_obstack, &pending_addrmap)); - } - else - blockvector->set_map (nullptr); - /* Some compilers output blocks in the wrong order, but we depend on their being in the right order so we can binary search. Check the order and moan about it. --=20 2.51.0