From patchwork Tue Jun 27 19:51:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Indu Bhagat X-Patchwork-Id: 113563 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp8434981vqr; Tue, 27 Jun 2023 12:52:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5pvISYDXbVHqW4YWtDu/EBR7IdCzcnWs/P1hJPx1kuyW3/PwMDvUTEffU2VcvLIAh/G5oq X-Received: by 2002:a17:907:6e0f:b0:992:1309:be3a with SMTP id sd15-20020a1709076e0f00b009921309be3amr2975297ejc.0.1687895524543; Tue, 27 Jun 2023 12:52:04 -0700 (PDT) Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id r16-20020a170906549000b0098d2f718ac3si4372945ejo.609.2023.06.27.12.52.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 12:52:04 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=AQWDDXjQ; arc=fail (signature failed); spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E7E573858C53 for ; Tue, 27 Jun 2023 19:52:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E7E573858C53 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1687895521; bh=V68GljL/2h34Nv7lzdSIqJhuxtN03Qhhk12JUoTaVac=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=AQWDDXjQ6HCsco3DuSklXC+gLA4UIMZhQ4jh1mv4X7N+wUfB6VL0m6op0Dl8rPK+N K8H7oJGhzu7FbUcqxhGj33zi9GpeBMessKu6T/ppX6aoP+4NZqY2W2eU34mMquFc+F mGqJ5FVQ+8BXQoP4PPwOUpRR6BEfTJayA2j6a30k= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by sourceware.org (Postfix) with ESMTPS id 3B90E3858D33 for ; Tue, 27 Jun 2023 19:51:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3B90E3858D33 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35RJFJhQ030685 for ; Tue, 27 Jun 2023 19:51:51 GMT Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rdrca5n6v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jun 2023 19:51:49 +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 35RJpKPJ019935 for ; Tue, 27 Jun 2023 19:51:47 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2109.outbound.protection.outlook.com [104.47.58.109]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpxas1uh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 27 Jun 2023 19:51:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ftGQUe6/FYO9OozhIG7l9oxRy2m7XT06HYlzQ12IUw7I2lxlcHo0y/+vhJSEZIwAk2rMzBQ831cuuB5pkgo8ozs9CZLNTXhvEYNXDOvcQ4OxpHj03EDueK+3nLBvq1kK4PP3IGbTl40oPVexMJ4lPCMCgjRbd9eBPARPGsC9L2HLbbaqrobr1ZBbs0BIyyoyxZI7rgmLrENHPaAzukLN0g3bCz3gmoh04+xwUNYyQBid8J1jrJAwIjY++ajbrJLB6LKsC2yi4t32fKxABtInrOD0pf4YmNloxHe2a7j3m+L2X0U2am5W0xD0/gs6BAI+DY2tBzjVGqaWuL3oTTEYpA== 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=V68GljL/2h34Nv7lzdSIqJhuxtN03Qhhk12JUoTaVac=; b=daLIhm00siLsDFmMFtEXsaTIODyCQtqyXqoBfwDOTKpLCpZz9cu5GNyVg2l3KbDRe8Zb1c/mZBcPs/blUG6oqqz7wAXi/B6FoRT479itkCqdhhwrgQCdyAJ6E1DBnfTVDyZmom2ltJ/2+e9zBVvFxqy7HvcPCY8kt6f4tmY6HpLiaqLXF6eSGFeyKyj+jANXucORk7GquY93pe3dkVORDpJGVOHCXLiIa8YnOnnHza4OfSwtV7tvW1vlVHce+S/2Zaba0V/WxAzpRcEG42uT6BwepJsL+AyimX2E+Z4Puhf/r8HtSpe2hQxul1zdMFkWsev4nGjInzb9oSio93V1Cg== 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 Received: from MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) by CY8PR10MB6803.namprd10.prod.outlook.com (2603:10b6:930:9a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Tue, 27 Jun 2023 19:51:45 +0000 Received: from MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::fdbb:b921:1ef:2d44]) by MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::fdbb:b921:1ef:2d44%4]) with mapi id 15.20.6521.026; Tue, 27 Jun 2023 19:51:45 +0000 To: binutils@sourceware.org Cc: Indu Bhagat Subject: [COMMITTED] libsframe: remove sframe_get_funcdesc_with_addr API Date: Tue, 27 Jun 2023 12:51:16 -0700 Message-Id: <20230627195126.1955051-2-indu.bhagat@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230627195126.1955051-1-indu.bhagat@oracle.com> References: <20230627195126.1955051-1-indu.bhagat@oracle.com> X-ClientProxiedBy: MW4PR03CA0136.namprd03.prod.outlook.com (2603:10b6:303:8c::21) To MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2158:EE_|CY8PR10MB6803:EE_ X-MS-Office365-Filtering-Correlation-Id: 9065b15f-359f-462e-10fe-08db7747eff5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NWmcv8EsJDvGM1iDqSctaGLI3DRcxpQjKi3uQSv6s55SgzaHuCQTb07J2L8vdTjkGlCWw0Yh1lPk4kf+jGl6gUV7uQQiUijiTVXncxabGHoj09O/9EG/eGbF1IzPx3YQllpK2zTxd7uUCER9qaYcsPDIAJkKYngoYqPWf6FWHqHYMd74p1DXxKKVSvkU/yakcz+F/DlDQu0XweZbO7GFRexXW8FHZmad5w2fJUYDa7ovtkhq0U2Px/dKgjkW1WhCfdyfWdrmEqAsJ1xL85sV/W4nyFcFYYdkUZ4ytP1LDGMRSST7cZvVRhteeSZ66tjG8ZNwyCpDiSg2T6HV0Cu553/76jrDSVdLgJCU9ZUgN2XzvKc9JJ4tcSllIPpzNmeH91qLVqjYyF5CH1k37Q0NMkC372ZckVxO1vuKQAFGqjtexWzfZG5QupnI4lt+/w5+eN/g2NGVej1nXnNyQHy1gsvJbdZ8l1NEyPRrwoxCpS1ZijDX13lGkzhDolvfxMoNkggt11Y+T9uqBOPYxD1lKMWcyN4ndwZYz9WJTS163I1XOAP37IEh9he/ILGxVyte X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1001MB2158.namprd10.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(366004)(346002)(376002)(39860400002)(396003)(136003)(451199021)(2906002)(186003)(6486002)(107886003)(38100700002)(83380400001)(2616005)(6506007)(6512007)(6666004)(86362001)(26005)(1076003)(41300700001)(316002)(478600001)(36756003)(66556008)(4326008)(66946007)(6916009)(66476007)(44832011)(5660300002)(8676002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WAfRvCUTyK1NfhN2/LSSVBT8fmouTrSp7nT9TdDSDEsZST5qtTquZpSy/Fb+EJpyhPH68dcohOJ+7qZwGsTo36UTNat6z/YEvzKqyuu7lg5kqn6jOJZ1lpzLCqvpXFm5KVVSzSqnBdFghRuErOWNmFqpYQioqkVPUrxoomcPVVGSig7942vkmQcIcBA3FmZg000a6WjfUibngklLj+OUNdrHFDUpErF2dJ6734pJ2vtp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HSOEZrnhJU15n3gyontvzvaVN0gYYBLnQVte0tJi/ZtlUQobbcfdduWYEb8F+N0PoegT85AJrIcIb00rZOtGu6l7xusSpMSY+iHxD2w1XWNRyL1/Ib3bBK+J2J4UMDQtDHlPrIY3dBjpag+GRAil+w/fDVNn5PEX0EThkGXH3rgp5JH85aqieJmkYG2MViXNuUo716+WB1foz8syxoJLqlCaXCDdUyK5VnQxMkZUT6o3hK+2a9I9zDAAacgOSH6c4rrOlzvila5e4ijXLY3xd2MxTmb3L4AwDsJyGUsv8 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 2CXliaJKscjJrAH/U2hn5HxPcfmZ3cJ9cRLdmT5meJAp/p4dV1Dt4/Q/8XhTyYwk4/b6t30mUKzHbUoBub5yU9H2Oc3ixDwpA7pbnmrDChEraV9e2D/RIZR780cNqSOjln8BnE5+nrW9za66HSnVJ8yGcweoOVh8ecXj52ynlcviJJ+r90eFnW5rLaAU+TYGlEVh86BTCWqgq0xxOQGnRok8EtuEJ7gnYN1pBbLecbWFmegHf7kBFuy9wG12NWjQepD5Z2BGIqQaNDiTKxx++i7pdVhXOt47l9NO29B8jTdqLkSiG38GIsyucRqXpenMToBn74buY/nfXfyaP0p3f+gXviMyRxRmQsCRINaN2rXpfnqwlXfxMTRvYw55T4y367/+xWzDGZgz5MIsFT589WlwT1DdukyfDN9IuWRox2oKamfo+LjswVSPPPckTsK5D15is+8UUbEQxbyPWRfGIz/fKzSJ2QWy8MC1kKWFu4A2kaDC+AyAObb+HHcZqsWkO+atWCFYAA6NIx4qyOQhm+J+soO29JdW5FUcauyyxhM2vtkpZ6ssxqJoGRZUnRzRKa7G/b2u2C8O4haUoYGeqyA4H6+u3u2yj6kIxwU04egac/zFMJfXGRWEoyNB0kHnQO935jLawPyKv/j1TMIruyMtk2+8I+/LMypPIxvFosAlChOEmuxzeEXtOoyoojK8dvVgfCDk2oZ21Z8x8RcjRBiV/Gf0PHH/AiN63e+BGIzvtVmSlcBxKcMCAHGjHJi2 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9065b15f-359f-462e-10fe-08db7747eff5 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2158.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2023 19:51:45.7094 (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: CncSG39JjUvRcDizLWIMr4qt74mWwoaWJFptjvShSVcgTEC9RZBZ00Jb85aS9sE87qnoKboAFDyyhcGzWzS5CA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR10MB6803 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-27_14,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 adultscore=0 mlxlogscore=966 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306270180 X-Proofpoint-ORIG-GUID: yMyyILfZbT2fsh-wTYmmlGr1yBoOaNxv X-Proofpoint-GUID: yMyyILfZbT2fsh-wTYmmlGr1yBoOaNxv X-Spam-Status: No, score=-13.2 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_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Indu Bhagat via Binutils From: Indu Bhagat Reply-To: Indu Bhagat Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769886737611259210?= X-GMAIL-MSGID: =?utf-8?q?1769886737611259210?= This is an incompatible ABI change in libsframe. The interface provided by this function is not a healthy abstraction to expose: the return type sframe_func_desc_entry, which is defined in include/sframe.h (the SFrame binary format definition). This ties up the library in a undesirable way. Most importantly, this function should technically not be directly necessary for a stack tracer. A stack tracer will likely only need to do a sframe_find_fre (). Rename the API to continue to use the functionality internally in the library. bfd/linker does not use this function. Change the return type of the previous definition and make a note about its planned deprecation. include/ * sframe-api.h: Change return type of sframe_get_funcdesc_with_addr. Add comment for intention to deprecate. libsframe/ *sframe.c (sframe_get_funcdesc_with_addr): Change return type and set error code. This API is deprecated. (sframe_get_funcdesc_with_addr_internal): New definition for internal use. (sframe_find_fre): Use sframe_get_funcdesc_with_addr_internal instead. --- include/sframe-api.h | 11 +++++++---- libsframe/sframe.c | 20 ++++++++++++++++---- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/include/sframe-api.h b/include/sframe-api.h index df1f5ccef4c..a00303a3598 100644 --- a/include/sframe-api.h +++ b/include/sframe-api.h @@ -133,10 +133,13 @@ sframe_decoder_get_fixed_fp_offset (sframe_decoder_ctx *dctx); extern int8_t sframe_decoder_get_fixed_ra_offset (sframe_decoder_ctx *dctx); -/* Find the function descriptor entry which contains the specified address. */ -extern sframe_func_desc_entry * -sframe_get_funcdesc_with_addr (sframe_decoder_ctx *dctx, - int32_t addr, int *errp); +/* Find the function descriptor entry which contains the specified address. + + Note: This function is deprecated and will be removed from future release + X+2 of the library. */ +extern void * +sframe_get_funcdesc_with_addr (sframe_decoder_ctx *dctx, int32_t addr, + int *errp); /* Find the SFrame Frame Row Entry which contains the PC. Returns SFRAME_ERR if failure. */ diff --git a/libsframe/sframe.c b/libsframe/sframe.c index 7308a45ce88..8837f878fb0 100644 --- a/libsframe/sframe.c +++ b/libsframe/sframe.c @@ -950,12 +950,24 @@ sframe_decoder_get_fixed_ra_offset (sframe_decoder_ctx *ctx) return dhp->sfh_cfa_fixed_ra_offset; } +/* Find the function descriptor entry which contains the specified address + ADDR. + This function is deprecated and will be removed from libsframe.so.2. */ + +void * +sframe_get_funcdesc_with_addr (sframe_decoder_ctx *ctx __attribute__ ((unused)), + int32_t addr __attribute__ ((unused)), + int *errp) +{ + return sframe_ret_set_errno (errp, SFRAME_ERR_INVAL); +} + /* Find the function descriptor entry starting which contains the specified address ADDR. */ -sframe_func_desc_entry * -sframe_get_funcdesc_with_addr (sframe_decoder_ctx *ctx, - int32_t addr, int *errp) +static sframe_func_desc_entry * +sframe_get_funcdesc_with_addr_internal (sframe_decoder_ctx *ctx, int32_t addr, + int *errp) { sframe_header *dhp; sframe_func_desc_entry *fdp; @@ -1053,7 +1065,7 @@ sframe_find_fre (sframe_decoder_ctx *ctx, int32_t pc, return sframe_set_errno (&err, SFRAME_ERR_INVAL); /* Find the FDE which contains the PC, then scan its fre entries. */ - fdep = sframe_get_funcdesc_with_addr (ctx, pc, &err); + fdep = sframe_get_funcdesc_with_addr_internal (ctx, pc, &err); if (fdep == NULL || ctx->sfd_fres == NULL) return sframe_set_errno (&err, SFRAME_ERR_DCTX_INVAL);