From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2068.outbound.protection.outlook.com [40.92.89.68]) by sourceware.org (Postfix) with ESMTPS id 5CFD5385BF81 for ; Wed, 4 Aug 2021 17:59:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5CFD5385BF81 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=hotmail.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hotmail.de ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jUtRGlR1pXGA0TFTWJOwgAzdn27Ko3dzeXXGwen9G8QeGZI160NxehTtZ9HUHiEceeK1B+yrcA+GEdrnP8yiVqv+j7YSUbNkknAihnH+PtOsKMMCYJLu7dkz/us3A+ZQdOZF+Mp1N9xG9v7R4xqXvaphCGXmqg6j/ESgyY52HCebR+9D90wUEBkw3CTrUnApvaMTTaUjklKAr4UxdZP26Y7jyC5gyveiK1F3R80XH2IbMIKEs1YXpMn8jmx2VqE+jdNfi/uYUN54OpPK2rriOfbwJio8ZIquSsxPde+FhWydkeAnqNfSkuCl4ljvQWo791x1Pv8JgVzSO/6cv+YYsA== 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=HViUNHo2NUJHaERdGsHyM69Et6z2UuYlofWkS8TDle8=; b=KF+WUWW+0wiNJ5WlpRpg06ofTx4teIFVVf7q1vWUgPgXr3/NK8aiXAXXFxht7vC6rClcP5Fevw2CTJsiKuDAKfH7fgdmK579hyXLV8GV7KB+mMrPQjwUyU9JVnQUUvXTSPWrIE43BFPWn1lzIcqJIJa+S98avYrkzGNeh51A8dr1TAkwbyXzn6pqZ+OjSQI67eT3hhp4hmcmTCDY8ueHbkmiVWsN7Ab+pp3/TyqP2R9X29MlmyFjw9JamARy2t1RI7JMLY1x4Xh0PW4PPxWfJdsnJaU1mUxYOw7GsKLpnXq2sh65EK9Wuhcwbr6PLeqVY2y47V8q/MY2voBw2zFp9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from VI1EUR05FT054.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc12::4c) by VI1EUR05HT026.eop-eur05.prod.protection.outlook.com (2a01:111:e400:fc12::298) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18; Wed, 4 Aug 2021 17:59:25 +0000 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2a01:111:e400:fc12::53) by VI1EUR05FT054.mail.protection.outlook.com (2a01:111:e400:fc12::144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4373.18 via Frontend Transport; Wed, 4 Aug 2021 17:59:25 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:6E5988FAB0B777F3F9223E84493EC69B535556ADEC235671F0FD798DE97703BC; UpperCasedChecksum:959403F0AFE4B1A289F33901E73551EB0A4B4C5CE2E3EF7AAFB26D9650661CE6; SizeAsReceived:8062; Count:47 Received: from AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM ([fe80::3d30:d151:570a:8a16]) by AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM ([fe80::3d30:d151:570a:8a16%9]) with mapi id 15.20.4373.026; Wed, 4 Aug 2021 17:59:25 +0000 Subject: Re: [PATCH 2/2] Ada: Remove debug line number for DECL_IGNORED_P functions To: Eric Botcazou Cc: gcc-patches@gcc.gnu.org, Richard Biener , Arnaud Charlet References: <5484735.DvuYhMxLoT@arcturus> <2152447.iZASKD2KPV@arcturus> From: Bernd Edlinger Message-ID: Date: Wed, 4 Aug 2021 19:59:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 In-Reply-To: <2152447.iZASKD2KPV@arcturus> Content-Type: multipart/mixed; boundary="------------2AAFE6B3900032B2EA91556F" Content-Language: en-US X-TMN: [A6Eybc3BlbyvCVpa6DYTiCbAxWRpP/7l] X-ClientProxiedBy: FR0P281CA0043.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:48::8) To AM8PR10MB4708.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:364::23) X-Microsoft-Original-Message-ID: <65e23d8b-581a-5cf5-e982-d24a54781f55@hotmail.de> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.101] (88.76.118.196) by FR0P281CA0043.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:48::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.11 via Frontend Transport; Wed, 4 Aug 2021 17:59:24 +0000 X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 47 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 00380d04-6e0a-4f3c-8947-08d957719881 X-MS-TrafficTypeDiagnostic: VI1EUR05HT026: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nkaMkmJBMzv1Nzqz6JGMeRVw52gPqF0LeU4rHsB7gZoal+lYYPmBN9hojP9TXk/8+VGLhHRjtijI4QzMnDcPo0PVsFIzLC/eQtEuGJvTjP7Qrr10ZyHPXdZQfCNbJzRkY4LCWMGEgpQbs9DzG/gZ6mrdRd6vYxeEra6wuXYBzcf6e1mTlY2lhNKZk6G8XYXBGyRhKCxaQYSVJXdqA8rbvdvayzu8dLn84gxrrh7CY/1Oe+cw/vrM+QOiP+2CPZenBjSld+2Nr2pnZANuxFa34UO4Xz5hoetlXn4Klxv7HDjpmc5Lf5Ul0cBO/sxuoqaJfmYGhkHQ5MpLm/6o9vmWdd23oPulKs6iwod2rluKfhlpTysA9Y1ZPP6fPnHfXdbszbNfvFWzo8zx0MQmZadn8zY/yiiXmulQYs8V2xTsDWbi/tWhaXs57wK1SQKBGc3Z X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: N+rQoxpOXVzGb2rtQm+aTYBU9s9FBiiAYatGPb+ypA9MXbRjxLt3zhMfp+Zdm/LRZE/WaYwsOlqZg3sfQZMQ0LFkBX6MlbVvcroz+FhJq6ISnBwePo44ivcfcS4lIKuooWMTGp61M1pMB8iF44Pajg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00380d04-6e0a-4f3c-8947-08d957719881 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2021 17:59:25.4806 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: VI1EUR05FT054.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: VI1EUR05HT026 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, FORGED_MUA_MOZILLA, FREEMAIL_FROM, GIT_PATCH_0, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 04 Aug 2021 17:59:29 -0000 --------------2AAFE6B3900032B2EA91556F Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 8/4/21 4:33 PM, Eric Botcazou wrote: >> The location of these ignored Ada decls looks completely sane to me. >> However, it was an unintentional side effect of the patch to allow >> minimal debugging of ignored decls. This means we can now step into >> those functions or set line breakpoints there, while previously that >> was not possible. And I guess it could be considered an improvement. >> >> So it's your choice, how you want these functions to be debugged. > > The requirement on the GDB side is that these functions *cannot* be stepped > into, i.e. that they be completely transparent for the GDB user. But we still > want to have location information in the compiler itself to debug it. > Well, I see. But it is okay that we can set a breakpoint on defs__struct1IP, in the test case of PR 101598. And the debugger shall only show assembler here. Right? Do you have an example where this location information is used in the compiler itself for debugging? Of course we could do something like diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index b91a9b5..c0ff4c6 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -28546,6 +28546,9 @@ dwarf2out_set_ignored_loc (unsigned int line, unsigned i { dw_fde_ref fde = cfun->fde; + if (is_ada ()) + return; + fde->ignored_debug = false; set_cur_line_info_table (function_section (fde->decl)); But it would regress the attached test case (the Ada-equivalent of PR 97937): $ gnatmake -O2 main.adb -g -save-temps -f produces line info for Test2: test__test2: .LFB8: .cfi_startproc .loc 1 8 4 view .LVU3 movl %edi, %eax ret .cfi_endproc while with the above patch we would get something like test__test2: .LFB8: .cfi_startproc movl %edi, %eax ret .cfi_endproc and, indeed it is impossible to step into test2 or get the source line if we insert a breakpoint at the label test__test2. I assume You would agree that having the location for Test2 is better than no debug info at all? So Maybe something like the following might work for You? diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index b91a9b5..c0ff4c6 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -28546,6 +28546,9 @@ dwarf2out_set_ignored_loc (unsigned int line, unsigned i { dw_fde_ref fde = cfun->fde; + if (is_ada () && DECL_ARTIFICIAL (cfun->decl)) + return; + fde->ignored_debug = false; set_cur_line_info_table (function_section (fde->decl)); This would remove the location info in the test case of PR 101598, and still have location info in the ada variant of PR 97937. What do you think? Thanks Bernd. --------------2AAFE6B3900032B2EA91556F Content-Type: text/x-adasrc; name="test.ads" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.ads" cGFja2FnZSB0ZXN0IGlzCgogICB0eXBlIEZ1bmNfUHRyIGlzIGFjY2VzcyBmdW5jdGlvbiAoWCA6 IEludGVnZXIpIHJldHVybiBJbnRlZ2VyOwoKICAgZnVuY3Rpb24gVGVzdDEgKFggOiBJbnRlZ2Vy KSByZXR1cm4gSW50ZWdlcjsKICAgZnVuY3Rpb24gVGVzdDIgKFggOiBJbnRlZ2VyKSByZXR1cm4g SW50ZWdlcjsKICAgZnVuY3Rpb24gRG9JdCAoWCA6IEludGVnZXI7IEZ1bmMgOiBGdW5jX1B0cikg cmV0dXJuIEludGVnZXI7CgplbmQgdGVzdDsK --------------2AAFE6B3900032B2EA91556F Content-Type: text/x-adasrc; name="test.adb" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="test.adb" cGFja2FnZSBib2R5IHRlc3QgaXMKCiAgIGZ1bmN0aW9uIFRlc3QxIChYIDogSW50ZWdlcikgcmV0 dXJuIEludGVnZXIgaXMKICAgYmVnaW4KICAgICAgcmV0dXJuIFg7CiAgIGVuZCBUZXN0MTsKCiAg IGZ1bmN0aW9uIFRlc3QyIChYIDogSW50ZWdlcikgcmV0dXJuIEludGVnZXIgaXMKICAgYmVnaW4K ICAgICAgcmV0dXJuIFg7CiAgIGVuZCBUZXN0MjsKCiAgIGZ1bmN0aW9uIERvSXQgKFggOiBJbnRl Z2VyOyBGdW5jIDogRnVuY19QdHIpIHJldHVybiBJbnRlZ2VyIGlzCiAgIGJlZ2luCiAgICAgIHJl dHVybiBGdW5jIChYKTsKICAgZW5kIERvSXQ7CgplbmQgdGVzdDsK --------------2AAFE6B3900032B2EA91556F Content-Type: text/x-adasrc; name="main.adb" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="main.adb" d2l0aCBBZGEuVGV4dF9JTzsgdXNlIEFkYS5UZXh0X0lPOwp3aXRoIHRlc3Q7Cgpwcm9jZWR1cmUg TWFpbiBpcwoKICAgLS0gRGVjbGFyZSBhIHBvaW50ZXIgdHlwZSwgcG9pbnRpbmcgdG8gYSBmdW5j dGlvbiB0aGF0IHRha2VzCiAgIC0tIHR3byBJbnRlZ2VyIHZhcmlhYmxlcyBhcyBpbnB1dCBhbmQg cmV0dXJucyBhIEludGVnZXIKCgogICBYIDogSW50ZWdlciA6PSA3OwogICBZIDogSW50ZWdlciA6 PSB0ZXN0LkRvSXQgKFgsIHRlc3QuVGVzdDEnQWNjZXNzKTsKICAgWiA6IEludGVnZXIgOj0gdGVz dC5Eb0l0IChYLCB0ZXN0LlRlc3QyJ0FjY2Vzcyk7CgpiZWdpbgogICBQdXRfTGluZSAoWCdJbWcg JiAiICIgJiBZJ0ltZyAmICIgIiAmIFonSW1nKTsKZW5kIE1haW47Cgo= --------------2AAFE6B3900032B2EA91556F--