From patchwork Wed Apr 17 20:20:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Alcock X-Patchwork-Id: 88607 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 EC6B13870890 for ; Wed, 17 Apr 2024 20:25:30 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by sourceware.org (Postfix) with ESMTPS id B8DC43858D37 for ; Wed, 17 Apr 2024 20:21:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B8DC43858D37 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oracle.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B8DC43858D37 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713385300; cv=pass; b=Y9RsoqbGO04E3fB/50TYfSZhMlGWyYq4oQzdCJAJcZNiuwT3tYu/X56poLnHClYXAlXbL6sPsvN9B8Uw86x7WV5GbLjGCLP6qc0warCqbwfj3VjhYtEdH/JzPgzYXP20j4G3P36c6ajbY1c3xIkfE6rIhL0jIQF+6oBHCk46ius= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1713385300; c=relaxed/simple; bh=/xj5rqqVLj3Bpb4dKLdP0GeKW3sJeKPaFv9X+i1g5VA=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=cTtqbxxlKB629TSvttHWZT0dJfaZHkEyVqgmkLaMg0J1beFnAQ7i1rYwjofNIBOE17B4lJAUA8F8Zr6LYfh+I2cgPy9GTC4SsMFbf9Touvmy0v/u23YDy7JXV46mSrsFBSXsGFRKlwE5s2dsIvjwmgPvEZtpNH81ZgBj8QH+GsI= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 43HHhf3E009917 for ; Wed, 17 Apr 2024 20:21:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=bp+4HARmI+KTDnUUG4TMyMFpQzA4u7vWVGIafNjBqs0=; b=Kt8VDBOmIbFOETpuKE9fX7URwkiH7NOuvvk4i0JBRUVZFgQxlug/Mj9TLAVP/LIriD5H FW6Clk1zemBBJPl2wpmwsfTFN8emI3A7b3R+J/cbB6hqsNEoRjkXOEY/w6iUeQKcw1Nx mbzj8t3Smu5tpXU0kJcHczcM59JpQqZTPU4VdI0b6yaQ5rfO1vZkbBtWoTY0m+JXVWwN PuUZT623SPznG7Dw4RYg4Q2xWcMOX7NtFxK8oLAxD248XC2HP4w1nymka7iqJw38efvj JwdAfSR57WEeUNEKE3YRdEvgJewtAowmL6fmZ3Xx4f90V5QMOka4p9/GUyvBdp8EgUZ4 aw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3xfj3e90cg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 17 Apr 2024 20:21:38 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 43HJBBfw021600 for ; Wed, 17 Apr 2024 20:21:37 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2169.outbound.protection.outlook.com [104.47.73.169]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3xfggfperv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 17 Apr 2024 20:21:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Fk01RBUwWvx1Ith8IJ3Nb3urSmFmH7x8aY0/5yzEUgMqdajxwJ4DkrXX5U2EjDWDeyi0YzkCqDjQyJo0Ec3NPLL3000dJ2CiI7GNb70e7wWkMMmul3/yBYoZn4xFH02ERjg86sxdH7HCK1XRYq4+DHcgI9Fhq1lLK1bttM3HXhFx36n2hIksANExAqwffItaqOuYYa5PJByK1cW4aadargePKVmhbxyNjq5jR7ZEEH7WDprBlA3K3c72ZDsvCY3FVMge+w/8RmvMwp3arHyIsFqsliInCK+BkKaGO9s/WcSamHXoqaOpKGUS1khtejdtCLrcoZYGlZDvg1ZMEzKQnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=bp+4HARmI+KTDnUUG4TMyMFpQzA4u7vWVGIafNjBqs0=; b=YhFhR3HFCBQdwZK9TbTp7/KKBUv7lgVQFqNjmxBoe6hwhg749MXpwb2KFj0Y1mCIRPmL/elnyPDvLHCalARrxijaABHHyTl77S6ynxo/JxylQpcimVcLBwhwzR/wT21WKi3CnTVrOO4qjkmMx7cPLgFXKsOLGjwoXjWZ80dgV7i5zZ3xngAHNnx5r9RVjXj1+2XpMFeimCGV3+FdRQiZMNmGOaJiWOSNy2Uu4SQ0vxQ3ntqpL/G5U8vikZkHDkh2wM+v2zXW17CNyqtApyBBTUhGiqB8mrqQ/XKUXCjsbU/DNV3II6WxgOj2qSEQJxYJ5vouHYeQRRuRhIGPwXXBCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bp+4HARmI+KTDnUUG4TMyMFpQzA4u7vWVGIafNjBqs0=; b=pbz8aHjp8bzyHV/nV/0Dn0/HOKrajkpGv3usTGg0UUcwQ9gU8nghItxuyybHavID6zQAeVRHcFGOEUgM3qFPKC/PmiDoWfGgdHhm4FAw0AhIOB15nxlKJUxbrLJAtnusIPM6qcJunNTKaQUqm7UWy8lbl3sVJyuE9AjKuIRlz7Q= Received: from MW4PR10MB6608.namprd10.prod.outlook.com (2603:10b6:303:22e::8) by LV8PR10MB7966.namprd10.prod.outlook.com (2603:10b6:408:202::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Wed, 17 Apr 2024 20:21:26 +0000 Received: from MW4PR10MB6608.namprd10.prod.outlook.com ([fe80::67a4:9544:7249:7751]) by MW4PR10MB6608.namprd10.prod.outlook.com ([fe80::67a4:9544:7249:7751%7]) with mapi id 15.20.7472.037; Wed, 17 Apr 2024 20:21:26 +0000 From: Nick Alcock To: binutils@sourceware.org Subject: [PATCH 15/22] libctf: improve handling of type dumping errors Date: Wed, 17 Apr 2024 21:20:11 +0100 Message-ID: <20240417202018.34966-16-nick.alcock@oracle.com> X-Mailer: git-send-email 2.44.0.273.ge0bd14271f In-Reply-To: <20240417202018.34966-1-nick.alcock@oracle.com> References: <20240417202018.34966-1-nick.alcock@oracle.com> X-ClientProxiedBy: LO4P123CA0608.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:314::8) To MW4PR10MB6608.namprd10.prod.outlook.com (2603:10b6:303:22e::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MW4PR10MB6608:EE_|LV8PR10MB7966:EE_ X-MS-Office365-Filtering-Correlation-Id: cec25c21-5017-48ed-2edf-08dc5f1bf56e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CUfDW5Wi3sRSMVMW+NYi8ozDpQVTESGlhkIaxXkjzRoXlpDPPUB0e+ga3CtiC+C8AWuEKMSaJPGYnyc8MSsGFSYE5ARQWZBq6KX+tqiGufCQI3596wEzGh+Q4guSZ/GyUM0BqE5sBy92LggSSbnmiDYmIR6k+WBPbEhUtzVbR2alCIJcWXiw0aWQEa2uFCUXNkDYxKqNub8eP1EbNSMzCxgtWQaNEvQDohia6NEj9al79wcUXz8ClJIAj/hUOlH6B3jz9nHwWGPQDb+k/zi3JaOHsayLSZWhyVHermefouLrnd+wUTzn2ZNlNKSXRlsPM1YYhtBwWddGzj29sRytpEKAGfFSQrD5UG9wj5MDzcu9nIyOt+tyU1Axwsd3JnAyYIDdfALrazYiZvg1kUyG9DPAK7wM2fCxqKwdqhJoYR9hp8DwG3GU56OBs5VIw+AEUp8AozRBrYgh/S/8lsuuKUl+Ygu0mkuD4OyN5LthI88UQbwFr/lD0Vs7anaTJ9S4mH+Yck6JXcRxtBuzxlSluMkgV1mXV/qD2XVFTYTrAJ6RltIbJJpV3Zeslau6FnE81d9g7KYm67XheCuWvgNIuJzUS6TiHm3TU3MmoGvhW+1FA3Dta0IFVc0AyNFMa87w6C9Am2vGJe9Z6oI2+3EJ4DjkHxkFxnBeQ+4HcN+x0DU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW4PR10MB6608.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(1800799015)(376005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DO4Izt95IsO/gxQHgLgeGvi1Hzb8/zhKY+ln9XzVVvNJ7pVhPG4FfiukfeLsVIpcm5lPwIsKUDx1BNp7cztWcNNy0N6/2B4HLO0nLSibBpNXD9YULcA8OyRTjQNvN2gXX3yPN2hTr3ugfyGWCF1ZRqcsHuyCmidEiC4IEese3hIE4PGgmrG+kDBtkOw5VTzfMFkjdtHOW8cO8Umw8dOjPOh9TlcNqeEaKe0wHbMXOCb3VSAq3vP2Mi4gDR71BhnFgPo8ypt8Z3Bkim7lAy+o+IytXvPDaxVMIHJII2tYI2a8UWPwoP7LYulzZh4n81W0HC5EnG/8P+3HWeHmxz07E9aVnQl7pi8XH3iuq3dLTCZPXo6Whnp1Yvf/uFbx5WDhrW7KusyJIh18ZQ1Vol62FeAG/1nRqsBf1KGHZRrccrnpPPYK2khxh6uazWl4YD7ZKqH+YoImkpBUFLrhKxaQgI0SIPSKCuN9tYg+klPNVnCbwr5CCAemv9Fp2sPXxR6aS/oxmKoMC6jp0MGBKKnxISzhQjwQuIgPkjJw4Pa/wMVw0j2LMhO3jyuxiC5AO0q00epgP1hmyeNo+oWF+OiA613ptS66I4f4aD7l5PDL8nTHD+4ibVorSUzfZCqDd5wIYfEpCfD4C/quHqqYFimMdNC0Lf6zp+SLEtaeCvKd3GwdUaagjp52rwHr5Cv+I20gmUiPJmo6d8/fSj3evtV6acp6kWajfvj4kBNhVKdvoqPvJCXyTXbHW41wM9SeqJAX44Vc+yWVLdp/LYc6kCFlFnVUAXYUkB3pVUvSOc3uO8czG2IMVtfbUqxlZu/3min3RGWbfEeDh0s4eeEqngIN7o/7PTGZhviyMzgZtxKB8xKkgkPvkdAzwCONxVlG4Am9ckoL80O1eH6SUQ/cUs6H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ZWSXmQQyW5LdWiw81gvh9qPuzyoWH7dHmUGqF55Gg7GNdRANsir4ZZAOtMb8F0IlUiQT5I6vq/4NGVk/p4FyDiGMi1wazOydraVHDBDu+7W63TOgLFk+fQJE/Vh2c7omt0wLTxyhhUZ20nTQ5AzyPk8l+q3s3HRKkSysUMAY2VwMOs42zRRn+dGedFjylQ3/ioM2lrZUqZsrtC6Zqjb5U3xxJj96WXSf//GqTSwkuOZuQBNcbBXAbak9hog681FZHS384pb9q7MRlUhud7ntTrMApE8N7cz84kERVHJmN63SX+lV1IIuxFGw0PWyg/rc2MHcq0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: cec25c21-5017-48ed-2edf-08dc5f1bf56e X-MS-Exchange-CrossTenant-AuthSource: MW4PR10MB6608.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2024 20:21:26.7050 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: svwfYoUf86nxStE2K2eAmDXnlIm3mH2IJHWESmpLE+v9M4Hr3SD9Rodq3XWWXQWjC3Vv+d91WHO4FkYGoVLI5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR10MB7966 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-04-17_17,2024-04-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 mlxscore=0 mlxlogscore=950 suspectscore=0 adultscore=0 phishscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2404170143 X-Proofpoint-GUID: UsMnDr2ARA_sTmi9MA3_FbuyvOEVQq0C X-Proofpoint-ORIG-GUID: UsMnDr2ARA_sTmi9MA3_FbuyvOEVQq0C X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP 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: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+patchwork=sourceware.org@sourceware.org When dumping a type fails with an error, we want to emit a warning noting this: a warning because it's not fatal and we can continue. But warnings don't automatically print out the ctf_errno (because not all cases causing warnings set the errno at all), so we must do it at warning-emission time or lose track of what's gone wrong. libctf/ * ctf-dump.c (ctf_dump_format_type): Dump the underlying error on type dump failure. --- libctf/ctf-dump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libctf/ctf-dump.c b/libctf/ctf-dump.c index 2213d09dc29..80a3b265297 100644 --- a/libctf/ctf-dump.c +++ b/libctf/ctf-dump.c @@ -239,7 +239,8 @@ ctf_dump_format_type (ctf_dict_t *fp, ctf_id_t id, int flag) oom: ctf_set_errno (fp, errno); err: - ctf_err_warn (fp, 1, 0, _("cannot format name dumping type 0x%lx"), id); + ctf_err_warn (fp, 1, ctf_errno (fp), _("cannot format name dumping type 0x%lx"), + id); free (buf); free (str); free (bit);