From patchwork Tue May 11 14:40:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Indu Bhagat X-Patchwork-Id: 1477167 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=s68jJ1zX; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FfgZF6hKvz9sV5 for ; Wed, 12 May 2021 00:40:21 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F3133398B158; Tue, 11 May 2021 14:40:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F3133398B158 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1620744018; bh=mmiDIbdQfxdUVBL0SsXZVGEdPvlQpjKsgYaEFZcvRPw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=s68jJ1zX6yapApInYTMoescIdehtPD+As2lvoh8Eg2GXcu5hZsLLVSZTr1vTyCaq8 2YqkpTWAhni+whZRGDDdNoxQ0K8HFKWMyWY7xCbMax2E0iQKUjhZx+4yMW4SM3bOfi UjrT/z6jm9QpdBa9LcusAWK2bQD5hNA4Xbj2aDPY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by sourceware.org (Postfix) with ESMTPS id 8BE76388C02A for ; Tue, 11 May 2021 14:40:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8BE76388C02A Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14BEYCA7154640 for ; Tue, 11 May 2021 14:40:14 GMT Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 38e285e7sk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 11 May 2021 14:40:14 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 14BEZrbI004731 for ; Tue, 11 May 2021 14:40:13 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam07lp2042.outbound.protection.outlook.com [104.47.56.42]) by aserp3030.oracle.com with ESMTP id 38e5pxc7j9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 11 May 2021 14:40:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UhFKyPKjf9Nm317iSa30h4BDh7wmJTipNoyRGADF1d8yP9e55dCY1D1kGMPo83CpCrmcaoXZHwoysYYdVoKJLQpeLerJxQ1Dd3aNYQrMit15FVAYtDFn9CuU4W8lKPGDrytfhq6SBi0nbWBZcHZc44VOjKUrvruH8Pf65//6jusq4WtJV3qOnmKS48d2BclkYJQujrSeGS76gMYZWAB2H9mI/EDPF1P3I9/8CjkveuhWTHUkAb6O9dpc/oktV3iYbuJolj6JUVsyK4lyAzd3u+DkGMTNtxNlC2cfjKfV/XSHVY5AKLvpTVMxbM96OvOl3omKhXpZNK6WKGOg3ij/tQ== 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-SenderADCheck; bh=mmiDIbdQfxdUVBL0SsXZVGEdPvlQpjKsgYaEFZcvRPw=; b=GgfLIC9jJog7wJn44aY45uXlm8bJnfgsEsBRX4kzzfyFOsSVUxUoZrF68UwapX5GniSoezAXIJgQCBwb2O7JUKDFGQ9iSNs9RmPFHu+zn3K1tdiGIk4Zt7fr8X2SpyCmdVinnONNVy29GfXUsFpAysED4cO9zamVw+q2QtaOhjtrAEnzmcpwDceMAoGiys57Rq20e4G4Z0p0cC8gongEuUezvxFicIXxGuGTLWFD+ay3AUKmrc3MVvqrZ/0aACmmN5I1+lM9si0TSW9I5i9I5R7UyjvE3M3HPTcK9aqnUqHuOJ3wJ4Fdtts7gUOtLityAsMfGtMXd6F80S3CiygJrQ== 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 CO1PR10MB4449.namprd10.prod.outlook.com (2603:10b6:303:9d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.31; Tue, 11 May 2021 14:40:10 +0000 Received: from MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::38f0:2cf9:7238:9ffa]) by MWHPR1001MB2158.namprd10.prod.outlook.com ([fe80::38f0:2cf9:7238:9ffa%6]) with mapi id 15.20.4065.042; Tue, 11 May 2021 14:40:10 +0000 To: gcc-patches@gcc.gnu.org Subject: [PATCH, V2 0/2] Fix write_symbols for supporting multiple debug formats Date: Tue, 11 May 2021 07:40:01 -0700 Message-Id: <1620744003-12647-1-git-send-email-indu.bhagat@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Originating-IP: [24.80.24.133] X-ClientProxiedBy: MWHPR2001CA0008.namprd20.prod.outlook.com (2603:10b6:301:15::18) To MWHPR1001MB2158.namprd10.prod.outlook.com (2603:10b6:301:2d::17) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from ibhagatpc.hitronhub.home (24.80.24.133) by MWHPR2001CA0008.namprd20.prod.outlook.com (2603:10b6:301:15::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Tue, 11 May 2021 14:40:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 451ef48e-13f9-4256-856f-08d9148aaddd X-MS-TrafficTypeDiagnostic: CO1PR10MB4449: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oDG6fx17TehbSoazufm1iZ3pApqAHM670kIUzJ6aSng5b1vhd7+J7RShGw4YmRb2I3oT2S7f1FJIOr1h+vPtpgOAJXPObVaBSe4Ur1xPiS51gMgzRPsECkpodh5t8lUIdlSjkspQ6OwCuCjrCdciP+GP3fPgOyVliMD55TnuP3jRWaSzEHxWxo6OyUIO2LTKP0/IiYhxJdMiHK2/tU8sg5+uOnwQPhLyLChJXlV42B0BzerkQyg4TPuJL5YhPDiNQp9B2OwgFQ6dXg1FhkTN2gzKmaMxesV8X/wUcfrPDT9iwPQRrtHpSq6xrVCafZSSmJ2mVHRE7wFea661ufp9sjkjUd4e/Rk2VuCUMFZrLtO4lQhr6SGt5dNZmWuKlyHyOs1Es1aGNU7jxrCQ28NdNkbVOgb4DeCbNTcBjrvXceYnk9Xyz5BM2mlaSis3W8HSsf8b99FJ8ECBK4XjKid1lHg4VurHlOTgqbrM7kQDzrgH7er9L6X2JWFWsOMZZ3AKWn50vaK8Ks84wV/qjUhLvxu3uLYFob/kATusXI9vll3ELM71dnopD5Ncvuj5DOAhR2FLyutQ5qAs+6vJhbJ5qiwNo4Zd+lGs60GvXUXh8/9H2zTxza8TaPAKGa1FY5XX2LJ/2+11aStX7MMaU2VRzw== 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:(376002)(39860400002)(136003)(396003)(366004)(346002)(6486002)(83380400001)(6666004)(5660300002)(38100700002)(6512007)(38350700002)(66476007)(66556008)(316002)(6916009)(2906002)(8936002)(8676002)(6506007)(44832011)(186003)(16526019)(52116002)(36756003)(26005)(66946007)(956004)(478600001)(86362001)(2616005); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: PRBDoEIF3LxdUAeRhsuz+waKF4FyP5W5Eu9fQdZClt0w1qtoRpt+3qB7EPbNgVs4wQ/zXYxF7h0Bv+feNwdDnYz8tg38Yy+9nK6W3FYiPuNrORRSElu+LHeraFY0YaN4TaYsK6qEGXEFRhqh2F8VHpmEc0aZk8dKsYBczts8Rx5fuWEDOsh9QK36qnmCsYG8w4urIOZkjaf2YbBbEGymaOAPBavUL11hjyS2CwkX3jsKyCCG0VYl7BXABzNUh7VOGo+FzAs9eAbR3e05RYfvZXh3h8S9kIv8Dd3YhsOwZ3IHLXDkCc4yXIAVI4P+XoZny2gBXNdM2tp5lYlVLJbHxcF/Gj0vfJU5rs5MI4TO7vOWcXUMsApTQDGpnA5xZylXHDcWeEYJDLPU6OEi1HtaeTOmp8R7Pt1+z6eA546EpkusdekacIMoocKqUmedjiFCOc7E/Wov3kBoJDyWb6Nj0ZC7Z6Bp+7rYG+mO3wZvNcVUB6sNX2QtGDMHr07s81L8plxj6zuYZtn1PYia79EhnQ0SI0sRxlMZlKilJhBzd0V1QTsrohgO4oDwmtP7nBUmC3WFvgft6VZE7YqHFrDYIEJslvwN8k6ltOMMzFy3H7GJ45c1aeHF+q9Ik1Qh0TjQfW0aLSqPm+o/FjUTa426no5p5JXCnv03LvXMA6gYDNuBUajY3jPM4xFwty98BeXievdv/2r4tl1SajcJV+pgZ2xD94N/Vnl1mHdgHDi0Z00Anou5BRa7LDfmnBtpSUMFQehtjPHn0D+BZkuyu1wqJJvGs8K08Ph1c4cq/iPYjNv/4SyUOEB+S6tGPPvYyOhvwyQnvYpDawEt12ZWH82oNiTqOLH5WwlFva0QqtUKzyjgwTlf3naWOprtInLo4D9SL76rTpWJnGxcABxHXd44DOeqE1Z5NRlpW7NP0gn9QoAVgdPkuRnU2/yHyXXmV4YhJGK75yHcpY8qBhT+Gm4WogASggA64gd5SYIirq+NlyY3AKkO0R7jC7yTdF1sJcxwXHy6bmtviYNvf0rFFTCTzDqA1yrxMgUI7XH/0vxZeH6GDM1B3kDCNT1FneeSTHywhiF9z0E1k1mH6MRWxO2apH6/UqrbBU856O9HbCyIJ8XkJoqD8/wukpXCT4jkK7qD9DwBdTBQc93eI0J8QS2WWexNfjzBU14+n1RCeDlbEnwgHzQ6+4R3LhV8g0yUL2niY48UDjNh8gAx0bNRAYl2kyFeRi0KDkjdm9cqGKGDB328OfxkHtCitTHYaSONNXGsgLg5zfeqrsSbxs1hkg+6NZyD+Fd6LDLDjEI32n3jOSJSggG6Oi6szZ234FTNlFP6 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 451ef48e-13f9-4256-856f-08d9148aaddd X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2158.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2021 14:40:10.5803 (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: 9yUVj6dnOmAZEA4eXUz9yeDIKn9ZagvER0zftZvEm9kcaaSGF707tJnHsdPsp4dF9LWihSNGR//b45pKT+ik3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR10MB4449 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9981 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 malwarescore=0 spamscore=0 mlxscore=0 adultscore=0 mlxlogscore=902 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105110110 X-Proofpoint-GUID: Z4cp6nsBOmDMtSqnCakTUWYctcrBJTJh X-Proofpoint-ORIG-GUID: Z4cp6nsBOmDMtSqnCakTUWYctcrBJTJh X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9981 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 mlxscore=0 bulkscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 clxscore=1015 impostorscore=0 phishscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105110110 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, MSGID_FROM_MTA_HEADER, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Indu Bhagat via Gcc-patches From: Indu Bhagat Reply-To: Indu Bhagat Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" [Changes from V1] - (Addressed Richard's comments) - For patch 1/2 [opts: change write_symbols to support bitmasks], use debug_set_names more uniformly. Reworded the diagnostics in c-family/c-opts.c and c-family/c-pch.c as there can be multiple debug formats. Updated the testsuite files accordingly. - Included more backend files for patch 2/2 [dwarf: new dwarf_debuginfo_p predicate] - Regression tested on x86_64. Open for any suggestions on further testing. [End of changes from V1] Hello, Over the last year, we have discussed and agreed that in order to support multiple debug formats, we keep DWARF as defacto internal format and any new debug format to be supported feeds off DWARF dies. This requirement specification has worked well for addition for CTF/BTF overall. There are some existing issues that need to discussed and fixed in this regard, though. One of these is the definition and handling of write_symbols. The current issue is that write_symbols is defined as enum debug_info_type write_symbols = NO_DEBUG; This means any new combination of debug formats needs to be explicitly enumerated, like CTF_AND_DWARF2_DEBUG, VMS_AND_DWARF2_DEBUG etc. So the issue is, to support say, -gctf -gbtf -g or possibly other combination of debug formats to work together, each one needs to spelled out explicitly; which will make the handling ugly. This patch set updates write_symbols to use bitmasks. Thanks, Indu Bhagat (2): opts: change write_symbols to support bitmasks dwarf: new dwarf_debuginfo_p predicate gcc/c-family/c-lex.c | 4 +- gcc/c-family/c-opts.c | 7 ++- gcc/c-family/c-pch.c | 12 ++-- gcc/common.opt | 2 +- gcc/config/c6x/c6x.c | 3 +- gcc/config/darwin.c | 2 +- gcc/config/i386/cygming.h | 2 +- gcc/config/i386/darwin.h | 4 +- gcc/config/mips/mips.c | 2 +- gcc/config/rs6000/rs6000.c | 4 +- gcc/dwarf2cfi.c | 9 ++- gcc/final.c | 15 ++--- gcc/flag-types.h | 29 ++++++--- gcc/flags.h | 21 ++++++- gcc/objc/objc-act.c | 2 +- gcc/opts.c | 117 +++++++++++++++++++++++++++++++++---- gcc/targhooks.c | 2 +- gcc/testsuite/gcc.dg/pch/valid-1.c | 2 +- gcc/testsuite/lib/dg-pch.exp | 4 +- gcc/toplev.c | 15 ++--- 20 files changed, 192 insertions(+), 66 deletions(-)