From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2015.outbound.protection.outlook.com [40.92.91.15]) by sourceware.org (Postfix) with ESMTPS id 2128438618D7 for ; Wed, 6 Jan 2021 12:26:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2128438618D7 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=hotmail.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bernd.edlinger@hotmail.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AAcsQtg9lSXm3Ol4CwQTbnVSfyWyFiWm3iHQc2m/7yZGsCNhcp6PPCDbk9ipn8Vq5M9YcXXXHTJ7shU0tkYr2F6crOV0mY63SAM9DMxh8CXKkNARBAR0OtCaKtEY/ySVKzsZF6a77AU5C+yYCKeL+zG0Qkso/mR9m3s5yXfiM0lbYiT1FpjH3r0JrRoJR5TEHK8XfbjiEbXpgzoFAq0mAoXrqRsnRucYlPTZ8e/u9mMe8p1gdZ0QNBFI2fOvlr3ofD1iEbF1LXNi5g/c1c8qaD/60H67bt2qZdYjpggGw3t9Hlgmy+QutPnvm0X5ZuI5tBiw4MriheBKr2Noc8/uLQ== 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=6PLYPGiB3TOzYhWw9cQ/fp+p4ipGVITz+AlgB2TgaYg=; b=SdbbkPJakDQ+WuMeDuWb8JfwPFo/Z7dwTNbCVMUJM78JSM2rtTv8hhWt9tgbMj2/d9rHqHK1qvO5nj4XeAvzQIuTMkCcamBSh52gDZLWLeF57QAq7WQ31rIzWNvPJkWWwWQLcANqz7mZ80Uj64L0qQGNU8YvmKtMryz1CwXhHDfO/AqwkD2HUOKitXapA/oRMwg++YoFKybb7LnfMscmpg0XNYuQveQneIrU08rjpmVJYTfPSeAI5PDI8ri0CbAKH3Yx/fgbp30fkMsOd0t89pGivp6TJhBYj9jfRJc+87kpWhnOG5fxwTcxM+yEIKu2nvqZyt6dRhuLDGk75Vn0WA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from VI1EUR05FT028.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc12::48) by VI1EUR05HT162.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc12::234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.20; Wed, 6 Jan 2021 12:26:50 +0000 Received: from AM0PR0602MB3410.eurprd06.prod.outlook.com (2a01:111:e400:fc12::40) by VI1EUR05FT028.mail.protection.outlook.com (2a01:111:e400:fc12::439) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.20 via Frontend Transport; Wed, 6 Jan 2021 12:26:50 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:578816E47427D464ECDFE6746BE6055701D77D044FD26C393A31D49674642636; UpperCasedChecksum:755619C3543208816372C160678BF1822848F13FD4DD0C1774F95E2A12E0372A; SizeAsReceived:7946; Count:48 Received: from AM0PR0602MB3410.eurprd06.prod.outlook.com ([fe80::60c8:86c2:bdaa:f0d2]) by AM0PR0602MB3410.eurprd06.prod.outlook.com ([fe80::60c8:86c2:bdaa:f0d2%3]) with mapi id 15.20.3721.024; Wed, 6 Jan 2021 12:26:50 +0000 Subject: Re: [PATCH] Add line debug info for virtual thunks (PR ipa/97937) To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org, Richard Biener , Jakub Jelinek , Alexandre Oliva References: <10885401.ZfXygJoTAh@fomalhaut> From: Bernd Edlinger Message-ID: Date: Wed, 6 Jan 2021 13:26:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 In-Reply-To: <10885401.ZfXygJoTAh@fomalhaut> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TMN: [b+b9ZIfR9Qqv40W5Ov1Ce+lGIW4+q0Mn] X-ClientProxiedBy: AM0PR03CA0072.eurprd03.prod.outlook.com (2603:10a6:208::49) To AM0PR0602MB3410.eurprd06.prod.outlook.com (2603:10a6:208:21::24) X-Microsoft-Original-Message-ID: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (88.68.3.2) by AM0PR03CA0072.eurprd03.prod.outlook.com (2603:10a6:208::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6 via Frontend Transport; Wed, 6 Jan 2021 12:26:49 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 3700fba0-e6bd-494b-e1d6-08d8b23e57e8 X-MS-TrafficTypeDiagnostic: VI1EUR05HT162: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Xd3NF+lrBWT/byNumKrmRAM1NYl4u7HzSU/FqsXgLGjuoR0Vj6mP2ySQoDQ1lP7NJHIK5V/44xrQiGKgu0nWkdxVSNQA9vL0sm87ekofMehJfPQse1AH3DEIGv+EZoulSDag/2LupB2IxJY4VLPEbL1HCCs4QdTLavpc0SxN63/6FtDSgjkKaGIXsPt3NMvAH9g3T5Dy+AQjua7M5YBPO1+xLHioMbeYNStTKd4ogyQjprc67NfLqGM6pB0cJaMP X-MS-Exchange-AntiSpam-MessageData: eMDAi9zYJO6k1pEp2vzBVfOtdXQXOKUUNTcH6+3Kc3HjKmncee4H0X5ckxbG5DJkjPL684G/toi2DIKWbABVxyPkL9l41NL+OdIACYmDJPmoCjwvR2fDaWD2Tam4u4E4TcpIhNmN1Cz/f0wgkiPkxA== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jan 2021 12:26:50.5281 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-Network-Message-Id: 3700fba0-e6bd-494b-e1d6-08d8b23e57e8 X-MS-Exchange-CrossTenant-AuthSource: VI1EUR05FT028.eop-eur05.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1EUR05HT162 X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, FORGED_MUA_MOZILLA, FREEMAIL_FROM, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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-List-Received-Date: Wed, 06 Jan 2021 12:26:53 -0000 On 1/6/21 12:49 PM, Eric Botcazou wrote: >> currently there is a problem when debugging a virtual thunk. That is >> a decl with DECL_IGNORED_P. Currently the line information displayed >> in gdb is completely bogus, thus the last line of whatever function >> is immediately before the PC of the thunk. > > DECL_IGNORED_P means completely ignored for debug info purposes though and I > think that the Ada compiler expects this semantic. > >> This patch improves the debug experience at least a bit by emitting >> at the line number information where the thunk has been defined. >> I do not dare to touch anything but dwarf2 debug info, therefore >> the patch is a bit awkward. > > Please run the GDB testsuite with Ada support on the patch. > Yes, I always do that, and this patch did not affect any Ada tests. Anyway, I guess this patch will need some rework, to probably attack the DECL_IGNORED_P without line info. One thing I remembered from previous testing, and I was not sure if it is a correctness issue or not, is this: As I had to call begin_function also for DECL_IGNORED_P, I noticed that there are a number of Ada functions with DECL_IGNORED_P, but their crtl->has_bb_partition is set, and therefore this block is executed with my patch, but it is currently not executed: See dwarf2out_begin_function: if (crtl->has_bb_partition && !cold_text_section) { gcc_assert (current_function_decl == fun); cold_text_section = unlikely_text_section (); switch_to_section (cold_text_section); ASM_OUTPUT_LABEL (asm_out_file, cold_text_section_label); switch_to_section (sec); } I had expected that functions with DECL_IGNORED_P should not need that side effect. Anyway I had not seen any effect from this. Bernd.