From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id aTqILxP36Wl7njUAWB0awg (envelope-from ) for ; Thu, 23 Apr 2026 06:40:19 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=mflmp7Uv; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BD5901E067; Thu, 23 Apr 2026 06:40:19 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,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 2F86C1E067 for ; Thu, 23 Apr 2026 06:40:19 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 541E84BBA170 for ; Thu, 23 Apr 2026 10:40:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 541E84BBA170 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=mflmp7Uv Received: from CY3PR05CU001.outbound.protection.outlook.com (mail-westcentralusazlp170130007.outbound.protection.outlook.com [IPv6:2a01:111:f403:c112::7]) by sourceware.org (Postfix) with ESMTPS id 99FE24BBA166 for ; Thu, 23 Apr 2026 10:39:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 99FE24BBA166 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 99FE24BBA166 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c112::7 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1776940792; cv=pass; b=DJEU0W4lctSvb7JIvLMbOV7nPZZLnCPqubK2ZznmReyrHA9oN2GSdgbtKUllfDy6gr6BRxOE0von3leuFYmRz5uCghBs4l3k0paBm5yqO585Wck/DxGBlTvddRURowcGJ3e8XVNWaX2NEH6Skb9UmVV15HO6djhDEuaGXwsunZA= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1776940792; c=relaxed/simple; bh=oAfaJJnDQby/9Z+1b5lpVhQXN9xAyIH+jc+VImASwQ4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=gInt80GIg7Hd+vnWILBDysOmLHKVVqW5WxehBYTG28VrxTOFLE0sOHcO0rUFNGVqdEqKabC1yS/nUS03S8M5KkBuoaPmAzOk+4cNGep7I/KrMlxXY3aEi7IuEsqjMF1hGcOlRWD0cmuMIMpIYPjqv+r0Am+3W/QqGKFfhKvYQkI= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 99FE24BBA166 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bWUOqQCdg2BVwZe5KDqDMIZrxviabLiHY4ra8EMMVbKN6bGwCQaR+FID4l0Kk1Lg+dZddBmS2GyUOUi7yP82sncTl9U35rCakspmkV9Xh5O174UaPmeOTjx55FY8x6R01XXDEz9mBnp4IlyFtSXmJqShPfCxQ1tW5072omumMNt9VC9LkIp+OJnIcriE9z4o9IUd44Oql+SylvCvKlrgQ9seUCexLIhuQbgqRRQEaFaZe3Y8Os0fh4WFDyh59sKuONnu/QeQQi4lFAENwBiv8iyv8xceh0EUbpk0eNyx6B0d6f9rMAF5sT1KEbPi5SMphdrk6CPsDQIow7Ck3CX32A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=03gO+StWNiIN+/NPE4HNlblbYS3/J0pfQvOxN47tAW0=; b=BcALI/EvXuqlPiqvSKi3qo9xtlTbe/u2XHyQaOL/NY73RYa0Pr7ZCNKXgGljnDyq3SECJzEvo/4WBhQs2Z/a+i5lnRiieDj0xCjYmM4qAngrlUCPm68RDAdEmwF5MYFLKzGI/pAXnNnLsaPNOFSG5Kd55LKlDarRBpoD1MyoSAQC4i26qeHpmnZaE6rPkt0e79Oxym5FtqLBnxIFfNSPnwf1+LWGgQRCvb0iAu5qkRC55OU0+fEZgVwN7xU9BPElhwVlUSfCrAmbEE5xM0g8+PioSRAJ1P/YlX1FrFlKp2XxxiTKu734apfo2spr/M1QWdWT+bYz8FPd5gRVFhy12Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=simark.ca smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=03gO+StWNiIN+/NPE4HNlblbYS3/J0pfQvOxN47tAW0=; b=mflmp7UvaZ+Z4nnhbJkUt1rGA+UFLBxMu8MvSPr6PGszpWx77QoxLyNDItiPgdiaBgCwNPKpkk3R6oYHjfJbYaxW+b4fPBLElM+AVjZ02gnOf8TqipUIrjPidZlFEvl5D/T3eftd73NHthB8zG+8lnO2LFBm0ADcK8rKjsAY47g= Received: from BY1P220CA0040.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:59e::16) by DS4PR12MB999099.namprd12.prod.outlook.com (2603:10b6:8:2fd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9846.12; Thu, 23 Apr 2026 10:39:44 +0000 Received: from SJ1PEPF000026CA.namprd04.prod.outlook.com (2603:10b6:a03:59e:cafe::8b) by BY1P220CA0040.outlook.office365.com (2603:10b6:a03:59e::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9846.22 via Frontend Transport; Thu, 23 Apr 2026 10:39:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by SJ1PEPF000026CA.mail.protection.outlook.com (10.167.244.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9846.18 via Frontend Transport; Thu, 23 Apr 2026 10:39:44 +0000 Received: from ctr-s27-hpe-19.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Thu, 23 Apr 2026 05:39:43 -0500 From: Bratislav Filipovic To: CC: , Subject: [PATCH] gdb.dwarf2: Fix fission-dw-form-strx.exp workflow Date: Thu, 23 Apr 2026 10:37:35 +0000 Message-ID: <20260423103929.3137187-1-bfilipov@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF000026CA:EE_|DS4PR12MB999099:EE_ X-MS-Office365-Filtering-Correlation-Id: c3f86fbe-fb19-40bd-8e0c-08dea124a1fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|36860700016|1800799024|376014|82310400026|18002099003|56012099003|22082099003; X-Microsoft-Antispam-Message-Info: fCIHynMM3Vs43Vt+hEmcfN5nRO9QdDDdOs6RDNR71pMi6jBEVWovN16REvShJO9WzX5OI11Z/NsKkR2nvFBng3tlCVThFxHKSF4K+bzBaHSfxMo8rWv2Bxq/YBCQuCGTRZo3w/aHgNbRWwmhJpOV2hBy2AphKyispgwEH9Wtnw2r3RKPQ4KyUZ9taS+4LsT+WVw1GB8Sbal0cKZbVk/VLRakmDkhwhx8Q8RMP6IZjBeH0XGVPg4q7A6U+97T3gTPFq5gWPgipSLP+P+RnEtV5UqWiXOvJnFyFyXiKoSSqCG9YVzwc//ATblz9qFRPyX9gp7WqQVqnLKn5j7LMkNccfxnNl+8bmWWnzVh8l8DWuAaQoMbpHQoaLHLJzKLkoG1fcTYR9X8hTMqNTCqnrIP19O6fGdG7OcLAJr69X5dik1dUb/ah1fZ4mIYfkp9dHQR1/HgmwntY/ApS4r4+IzcsB8MM5QovEPpJM9whZ8Uihi7XOS3tOC+t0nHln3UsHfxDfujhnWfgo5JvoEJr+hIaDmVRoKaN3BYSlHUPX2e2/lokXacINwFPwtiuuGPFdpWwbYECDsmHwbk4VmLnRZipFfHKIq3pwLMaYl65g04wkL3qLH5FnMQ1JWAKlB9Qt+uGilbLNMauUPTkN4tdeC/GPboj8uy4Rfk9fSaVF4yq25FHZyifyg3t1VhEqa5lgTflPoBoWp9tI0de/axGNWNMe+mlv8CS8WhMowQFqbUtj4yBpYmTqV6NTChlk/idCdQU3qU0+maSvrp7FSpuj9e7w== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:satlexmb07.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(36860700016)(1800799024)(376014)(82310400026)(18002099003)(56012099003)(22082099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: bxeVaHacztzREjRBv43k/6rnzjcMOIfgVvpyyYedJlBWsuDEku33Mwr2190t6bPe4ilstwgnfiD/8DFy2etleJGP68Fp8qo0hvqZmhRo1tDN2ob3xzctpVurR4bSkk9x4upgzZ5+NMoDnBSNEbS69+ga23r+oVVMahURoJ+8A63isLnn3mPDiM+vax1xTsvZ98Z9wZZPf/uuy7gPBqQj9wzPWKLmrEPfw99AW41q3LX0J+syVZpnqjcM1FiR16xHAL6pGr+fLOY0fvCgHGsksUd9aUsE39mkqaKV1h797016o5nNe0llJSb0tiMGTy3nxhbkhV3381lxtulDHNmnDs/LManeNsLblM5S42ox7wn618TCaer4EkOQRLi8QNpzu7LBatKiv8yYYh9EiaTo6wJp212nTm63I/qiabnaEMAftXXs01KOVvXPb2ObRUUk X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Apr 2026 10:39:44.0298 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c3f86fbe-fb19-40bd-8e0c-08dea124a1fa X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF000026CA.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS4PR12MB999099 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 The test was using gdb_compile_shlib to create the .dwo file, which runs the linker. This is incorrect for DWARF fission - .dwo files should be created by objcopy extraction, not linking. Per commit 6a29913eeb9, "it was a bad idea to generate a .dwo file using the linker, since the idea behind .dwo files is that they do not need to be linked." GCC's assembler doesn't set the SHF_EXCLUDE flag on .debug_*.dwo sections, so the linker preserves them in the output. Clang's assembler sets SHF_EXCLUDE, causing the linker to exclude these sections. Both approaches are valid, but only the GCC approach happens to work with this test's incorrect use of the linker. Rewrite the test to use build_executable_and_dwo_files with the split-dwo option, matching all other fission-*.exp tests. This uses objcopy to properly extract .dwo sections without involving the linker. Changes: - Use build_executable_and_dwo_files instead of gdb_compile_shlib - Generate both skeleton and DWO CUs in single Dwarf::assemble block - Add debug_str_offsets section for DW_FORM_strx support - Add is_remote host check (required for objcopy-based workflow) - Fix DW_AT_dwo_name to match generated filename Tested: GCC 13.3.0, Clang-23 (passes) --- Thanks for the feedback Simon, I've rewritten the test to be more like the one that you sent to me in your last reply. Also I used DW_FORM_strx instead of it's DW_FORM_strx_id alias. Regards Bratislav .../gdb.dwarf2/fission-dw-form-strx.exp | 56 +++++++++---------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/gdb/testsuite/gdb.dwarf2/fission-dw-form-strx.exp b/gdb/testsuite/gdb.dwarf2/fission-dw-form-strx.exp index b0b842fe911..313e4eafe76 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-dw-form-strx.exp +++ b/gdb/testsuite/gdb.dwarf2/fission-dw-form-strx.exp @@ -17,30 +17,26 @@ load_lib dwarf.exp +# We run objcopy locally to split out the .dwo file. +if [is_remote host] { + return 0 +} + # This test can only be run on targets which support DWARF-2 and use gas. require dwarf2_support -standard_testfile main.c -dw.S -dwo.S +standard_testfile main.c -dw.S -set main_asm_file [standard_output_file $srcfile2] -set dwo_asm_file [standard_output_file $srcfile3] +set asm_file [standard_output_file $srcfile2] -# Debug info in the main file. -Dwarf::assemble $main_asm_file { - cu { - version 5 - dwo_id 0xF00D - } { - compile_unit { - DW_AT_dwo_name ${::gdb_test_file_name}.dwo DW_FORM_strp - } {} - } -} +# Generate DWARF assembly with both skeleton and DWO sections. +Dwarf::assemble $asm_file { + global srcfile testfile -# Debug info in the DWO file. -Dwarf::assemble $dwo_asm_file { + # String offsets table for DWO. debug_str_offsets { dwo 1 } int + # The information that will be split out into the .dwo file. cu { fission 1 version 5 @@ -65,22 +61,24 @@ Dwarf::assemble $dwo_asm_file { } } } -} - -# Build main file. -if { [build_executable "${testfile}.exp" $binfile \ - [list ${srcfile} ${main_asm_file}] {nodebug}] } { - return -} -# Build DWO file. -set dwo_file [standard_output_file ${testfile}.dwo] -if { [gdb_compile_shlib $dwo_asm_file $dwo_file nodebug] != "" } { - return + # The skeleton information that will remain in the .o file. + cu { + version 5 + dwo_id 0xF00D + } { + compile_unit { + DW_AT_dwo_name ${testfile}-dw.dwo DW_FORM_strp + } {} + } } -if { [is_remote host] } { - gdb_remote_download host $dwo_file +# Build the executable and extract the .dwo file using objcopy. +set obj [standard_output_file "${testfile}-dw.o"] +if [build_executable_and_dwo_files "$testfile.exp" "${binfile}" {nodebug} \ + [list $asm_file [list nodebug split-dwo] $obj] \ + [list $srcfile [list nodebug]]] { + return -1 } clean_restart $::testfile -- 2.43.0