From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id hLW+Jh7iaGp8ADIAWB0awg (envelope-from ) for ; Tue, 28 Jul 2026 13:08:46 -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=3r98C2o9; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 4F0D61E099; Tue, 28 Jul 2026 13:08:46 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.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 autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 6F8921E099 for ; Tue, 28 Jul 2026 13:08:44 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4FF794BB3BB1 for ; Tue, 28 Jul 2026 17:08:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FF794BB3BB1 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=3r98C2o9 Received: from SA9PR02CU001.outbound.protection.outlook.com (mail-southcentralusazon11013062.outbound.protection.outlook.com [40.93.196.62]) by sourceware.org (Postfix) with ESMTPS id 0A1754BA798D for ; Tue, 28 Jul 2026 17:08:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A1754BA798D 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 0A1754BA798D Authentication-Results: sourceware.org; arc=pass smtp.remote-ip=40.93.196.62 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1785258496; cv=pass; b=R/ocUEYofwHWoHXXE0iwxI2+76H4ImCeKoKvSBaSzUsAK0esjhqNDZFLDByvYU81/HOTrGb7k3r5l1lfIV3pd2KQ2cCfB7Mny/m0sL8QSo+Iegrfc+nXTEwsJJbAand3DT2oKYbfUpnlJWVxnPeed8tsmoAO1PIGINYwOyirI1w= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1785258496; c=relaxed/simple; bh=HU40E7DdMXsSRG1nkC3PpNuKMbiNNViP7hYZvw2lZFM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=BTO8nfz+hyI/gU0k+oh44AUjRTGMs6qqujFaW6FAdfXx9kybvq/mxfKMN6LFwDEfI4IbXn+C21EiPJGkh9a4NYvL/mwOyMdItcY5Qw95w5/wjjx3eWJM96qQhrGQdp6CBhgCjYgDixbnnKHCiwpgY/b7EJ4cP3UC8lkcECcWykE= ARC-Authentication-Results: i=2; 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=3r98C2o9 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A1754BA798D ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DMCCCju42+U4lAzhq3vOhzup1+AYfyk4fewqLQFi6vv8vMSp3zFnhQ4rClJdp477+VfGPvwj4ro7kcDns9E6Jo4tYkXA7LXjET6BXwSWzNvQy9QCZP9klJEf5BCxNixBnTgLxERSKeDzFVjZZivFDfunFROf8+I1BwkrNO0j91VXftXxHXaVDRVxiV0Ez7SGS8sUDmJBYpodv6UCesTXEQFxuDh+nHeMc5+QerIywlFpp6G2nKABBm0drjobHbMYidCu85R3H1WJldHBGV7SXiBMEvfaco0Omg4uIa5BIy6aAS83hCjNzgmqng+aD4JwLCipzn7rqCTcDQez7RUbpA== 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=a998wE7JVkEHU4cNGf3hStMwf8ab24ITcKDCfKmG+cw=; b=SYBkq6LY+5tZy2C4QL44nuFZWVcqzBmS7NUTDBwk541/WaD5GbEdcAbPNrPuu70qX6iN8aBwt3mFSDJ4fzq+Zf8nkthse6Jgp2DtxpOhxJWUX3FyxSh/uX08H1tJvX9yiHQ1fH62ZKhWf2t5cdUyJjG/2ZsQDmUVg1Gxne+lCVzUzXRAiftoFbz4fCHJ72wk0sKiURNfgAIXWc9+jGwA/cNwWckZehHEmKTMGcIMc053u6AkkmW4eLGYOmwvWk5out5Ts4OmLIvGVWmfoyfCfOgtI+rstvLIm3d8BHyKEY3FBxr5bEpEcmbASQAia95Z98xVhCaSZ4y5qnrhi7qwvw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org 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=a998wE7JVkEHU4cNGf3hStMwf8ab24ITcKDCfKmG+cw=; b=3r98C2o9M0U95B+J/yg4K7BjAx9qeezJiyEVyiwAS+Z1XpaB2Nhcodz524CZaxbk8hQVNJ3ahQrinOoEodpgjTkTkK+pPflLjiEseMnrO1JTOguTKhQz+Zf6rFLuCnR9OG9tW0dZv+3nOkGyjBfUollNr2JwcQsnq/jSwzSvIok= Received: from BL1PR13CA0026.namprd13.prod.outlook.com (2603:10b6:208:256::31) by SN7PR12MB6669.namprd12.prod.outlook.com (2603:10b6:806:26f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Tue, 28 Jul 2026 17:08:06 +0000 Received: from BN1PEPF00004684.namprd03.prod.outlook.com (2603:10b6:208:256:cafe::41) by BL1PR13CA0026.outlook.office365.com (2603:10b6:208:256::31) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.12 via Frontend Transport; Tue, 28 Jul 2026 17:08:05 +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 BN1PEPF00004684.mail.protection.outlook.com (10.167.243.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.5 via Frontend Transport; Tue, 28 Jul 2026 17:08:05 +0000 Received: from rocgdb-taktemur.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.41; Tue, 28 Jul 2026 12:08:03 -0500 From: Tankut Baris Aktemur To: Subject: [PATCH 1/2] gdb, dwarf: update code style in read_tag_pointer_type Date: Tue, 28 Jul 2026 17:07:45 +0000 Message-ID: <20260728170746.1037942-1-tankutbaris.aktemur@amd.com> X-Mailer: git-send-email 2.53.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb08.amd.com (10.181.42.217) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN1PEPF00004684:EE_|SN7PR12MB6669:EE_ X-MS-Office365-Filtering-Correlation-Id: 05900d32-7397-4d46-94b0-08deeccaca73 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|36860700016|376014|23010399003|11063799006|56012099006|10067099003|18002099003; X-Microsoft-Antispam-Message-Info: eMAiU/7uJ413E0zK9BXnhE9Cxzc0QImgt9D+z5L8ixpSWwU9rowANAvMqYTzoTkDufaDXTOXjlFfr/8aHT+a4y98AkiWd6nHuCjCoUgZ2GfXtQHI1Oh8UWLfr6Acrl22pjVVJvP/VjTXKrpEgeUigr3px4gOzqc1tUwgWO2y5hPLaM6m/dCU3ccpTeoc0vOy9mWMMR9bRn4P1ch2P7LDvQRd0l0E9w2YXrAnU0mbzcinuu8lUbSMkss+mIiIzIKJaw+DYaARPkzpTpdvBAc7g7XUoYj9ul80FyIBuXr/sJ/tmmZvEa+SjdxUF+EHrkjPMwHCvFvPbwOM6jC9Dp2GZOyssdB/vW9+prygSyrTuecYs/XV3S+pY1eSE0atrZwrG7lGN0abPK4UaYBsvND7Kj5p/I9pkN7yEMX8EERY+y1jm2X5N1K/WsyAMzfDhpHxpIdf/NT4HP8qwmlQsA3eCoHEYDQMUJtiMZ4Bqnx77hNfBhcOan5VRZz9qvl/0miYMoT6zfs6U69u6W4eqbDa3iuK+L+GIOv6IzlmTgn+CHPlkW6NSVfP2LAog6YeoC4dgYlIJ3n0IqJvzinorwXxhSpw933aZB1/HyEoRwT6qpOILYhq5sjupX2j5WI9ZSELxNDSSm5lXToMdeoU4yIy8DGOcQQX7fhSwSQ9JIuQbNNbrlAjawS6upve4AxB/YBv8NKHjvqc8ny2GcTUQ+17sA== 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)(82310400026)(1800799024)(36860700016)(376014)(23010399003)(11063799006)(56012099006)(10067099003)(18002099003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kivWfiDBj277UenuMfJrv0lm8ShMsoqbGJ/vrgOpFL1uPTl94g6J4ddq2cq79LdorI5kpC0wllKVCnnI2393JFOYL/iw4zd13QahzCFYA6QdFQjQLmQMiaGnZIgue8Z6npvO07X3upgZ2i3PyVuhx0XVPp5abo51Yf3S4kmigBqNryM8TGPdMF3N+R/MUDLEWn6lMznLBaXVfWJOKSaSqe6eQaAPGvaZ4G2/vKSMfHi1EvrFKwRe4oZi1OetEfqk4OF/6Yc/SvxPcia/DDzGZd973Xec2a3umnCbj22P9hIEA/M0OJZnE5a6JgHsTFeKs36pOJHjef2J/fuWUvCZxRse4dYQVCPM3DzlcNmta6DdUvYKoklFCMDu9oGYYJQjiU5E5rYp1YwtldzR0D+dQ/aguCqgnGLPJoLue+UJFL1VFq11yVhtgpiuM6c3e4W/ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jul 2026 17:08:05.6886 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 05900d32-7397-4d46-94b0-08deeccaca73 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: BN1PEPF00004684.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6669 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 Update the code style in read_tag_pointer_type to match current practices. The declared type of `byte_size` is changed to ULONGEST because we are reading an unsigned constant. --- gdb/dwarf2/read.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 38c498b1901..7db76140319 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -12001,10 +12001,6 @@ read_tag_pointer_type (struct die_info *die, struct dwarf2_cu *cu) { struct gdbarch *gdbarch = cu->per_objfile->objfile->arch (); unit_head *cu_header = &cu->header; - struct type *type; - struct attribute *attr_byte_size; - struct attribute *attr_address_class; - int byte_size; struct type *target_type; /* In Ada, it's possible to create a self-referential pointer type. @@ -12020,23 +12016,24 @@ read_tag_pointer_type (struct die_info *die, struct dwarf2_cu *cu) target_type = die_type (die, cu); /* The die_type call above may have already set the type for this DIE. */ - type = get_die_type (die, cu); - if (type) + type *type = get_die_type (die, cu); + if (type != nullptr) return type; type = lookup_pointer_type (target_type); - attr_byte_size = dwarf2_attr (die, DW_AT_byte_size, cu); - if (attr_byte_size) + ULONGEST byte_size; + if (attribute *attr_byte_size = dwarf2_attr (die, DW_AT_byte_size, cu); + attr_byte_size != nullptr) byte_size = (attr_byte_size->unsigned_constant () .value_or (cu_header->addr_size)); else byte_size = cu_header->addr_size; - attr_address_class = dwarf2_attr (die, DW_AT_address_class, cu); ULONGEST addr_class; - if (attr_address_class) - addr_class = (attr_address_class->unsigned_constant () + if (attribute *attr_aclass = dwarf2_attr (die, DW_AT_address_class, cu); + attr_aclass != nullptr) + addr_class = (attr_aclass->unsigned_constant () .value_or (DW_ADDR_none)); else addr_class = DW_ADDR_none; @@ -12060,7 +12057,7 @@ read_tag_pointer_type (struct die_info *die, struct dwarf2_cu *cu) } else if (type->length () != byte_size) { - complaint (_("invalid pointer size %d"), byte_size); + complaint (_("invalid pointer size %s"), pulongest (byte_size)); } else if (TYPE_RAW_ALIGN (type) != alignment) { -- 2.53.0