From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2076.outbound.protection.outlook.com [40.107.243.76]) by sourceware.org (Postfix) with ESMTPS id 60FF33858C74 for ; Wed, 10 Jan 2024 07:41:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 60FF33858C74 Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=amd.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 60FF33858C74 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.243.76 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1704872463; cv=pass; b=DkgH6ZAF4xnxeuoFfy1v5n1PnhYKQpYYDHgsc0FohK0vgQFHfCFRcsx6VxWjHTEQnMg/mX2Ehp3G2WnMCYfD1qKjzhK8rwX5rMtnoZ05glNHLy3iAcjqit6UBToirkAS3fEc21bnd1cXUdrqtQ/pGEmzM1biq6R83CN7xsKHTaA= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1704872463; c=relaxed/simple; bh=+2Dew2ndBxTEbR88OpYh/n/wSIpKNdcKTrzclTV88HQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=G1W4YslnYsCa/3AbURB1f5MYC67lWgXIk40h4LItspjziAXT+SD/hWABQtB5OeY0QUfjrN3IB+8U9AYBJV+W6SCs+kKvsVS0cS97/WzeMsHPuC17acBD2xYErqTTM9+8JqLkcot6l1THWX1Lkg6XCj2mPkYWyz78LC6BJ3f0c6I= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HHSzwr33612AY+B5ipJBCX8PDth41iTjm/4Tz8xr3UHAk4LuYj8SqllnFME1u1MMC6dt2k0BgJMdZ8aBcdH/WOwmuMUjCKVcxLwMyfNiEIFT8IZUJVTwjC+5uj5H5XxAOTpQIXcwNzfjzS+i3ImWaOff2eUQbyQllFzZJSSnpaox/QAEctNCVE0LBXo5aHElatGSpe2JnQjITAbe3JbH3SSu1nfpPCOp+eBy91PqJxNYH/zvBnSgy+iWIBh5cDUL6qVPOdqIhedbacvyJpf0g5AKhnf47EOsiPaYWkgA2dCUWhuaQ3pSMtcDH+PDuw/X+yIfAoc9Cd8a/pFtBp/Mig== 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=4Up5GNLvkawzrbYCtIzs7w8WPi/cyvA7eVe/rJ3fbAA=; b=WkSIYqg6ZVeef3QMFPHmRbS6qVWwoSgiQ8MTG4rR2HXmSkyR4JqDqH3GfRIxq7jSZGBX5cBcuz3Vxl9O+W90CBjbegc3/oUZblPo7Kn7OzW8M9fx2fZ3eeNxulnVy0YFSWe5qgQzpGgs4NTIHLxcTlc75ox1g63+ohmn+WvDoKsK8RvqXOTj/tkGPzzvAScz0sns4UTNTDvyIue3ujAb1w6AB7Macj9Jp1NMuPfchu6nU2ZZUOJioXAUHZ0pI/QTrqoT4w0QAZdlXKtN6ZAfu+bXwifaraYlVOxMiSSITNNvmYmA42ofjPT0jsBQ18HooRZbmbGmBcFe5YlXWTg0Lg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4Up5GNLvkawzrbYCtIzs7w8WPi/cyvA7eVe/rJ3fbAA=; b=LDdxI855ANTavZau/ND+IbX9L+PpMf6w+mtJObXLKlz403jii26pGFnPzJHuFnpHkdm0NdXGq4OFfBFNNauZWLP12QvxMbQ2bPtXnDjUNsYREQjtp5JOMsYanBWQEf/LBzSJYIMMGtdWAz5icZ9gilpNv/OL0r+0Vo9+a2H9gMY= Received: from BY5PR12MB4965.namprd12.prod.outlook.com (2603:10b6:a03:1c4::16) by DS0PR12MB6440.namprd12.prod.outlook.com (2603:10b6:8:c8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7159.23; Wed, 10 Jan 2024 07:40:57 +0000 Received: from BY5PR12MB4965.namprd12.prod.outlook.com ([fe80::b222:150c:795c:16e1]) by BY5PR12MB4965.namprd12.prod.outlook.com ([fe80::b222:150c:795c:16e1%7]) with mapi id 15.20.7159.020; Wed, 10 Jan 2024 07:40:57 +0000 From: "George, Jini Susan" To: "Ijaz, Abdul B" , "gdb-patches@sourceware.org" CC: "tom@tromey.com" , "eliz@gnu.org" , "blarsen@redhat.com" Subject: Re: [PING 3][PATCH v5 0/4] GDB support for DW_AT_trampoline Thread-Topic: [PING 3][PATCH v5 0/4] GDB support for DW_AT_trampoline Thread-Index: AQHaOYFyYEtl1UJpQ0KuP72gOVqsvLDSqXFx Date: Wed, 10 Jan 2024 07:40:57 +0000 Message-ID: References: <20230816215349.6198-1-abdul.b.ijaz@intel.com> In-Reply-To: Accept-Language: en-US, en-IN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Enabled=True;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SetDate=2024-01-10T07:40:57.138Z;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Name=Public;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_ContentBits=0;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Method=Privileged; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BY5PR12MB4965:EE_|DS0PR12MB6440:EE_ x-ms-office365-filtering-correlation-id: dc188d59-bc82-4577-cd5e-08dc11af7bf0 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: n83h3LKJbHGkC72KQkN0AQXCaxGxJm1tXcjL4c+r06wXgyTWxebzke7bD1UH5X8t3Zi8P92KF0ykCGROk2tUU3MUuWADm637I6SaB0WGBkyddhNy1R3xpwiTDN7EnVtaYnc8aqu+1x3KIj4yqjN8yDBGpLf1+mJkAsoLV/W8HBUb6/l5XSufPYotxumwg83nfs5RViVEotXgRLM2bApwPjRBTqxqmqYEy6sUI1dyQWOpSO7DXnnLsjwjhHtXKbBDSgVZYLoDP/OJDh1ECH+gJ2bje0sz0fY2Te0SejJ0ffath7eBQ4veH16sxnn/VGrKUT5f7DZv6gqYy+3r/u9Yx3ykGqDuL5/MNcGEq4ahfHKp4Q7eQWcoj9ms2147f0SXLRkFPwJ+4EitGsg3CY0idzu0Imnc6O2VOyN523mcukjhJKqUScBZeHPWINnvfSOKoDYoqMVX25B4PkM06MaqgloBftu/ofRs12jHIifDl3z1Zw03sMXBNfSmHpO7S8bxPP98g96P7N7EhEdBkl9iVdMi6NiAqwHWwWJNn3LJRRy+MO0LV2onLBkon/WkcNX5uU3+7QK99dmAgC7mRSvOP/Gr5QxJIDqaicmKcrTkMGvyMxWtdKI4hQ1ZOf3ZECTuG7aTReshwD42+4+luVd30Q== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4965.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(366004)(396003)(346002)(136003)(39860400002)(230922051799003)(230273577357003)(230173577357003)(186009)(64100799003)(1800799012)(451199024)(5660300002)(2906002)(66899024)(166002)(15974865002)(86362001)(41300700001)(33656002)(38070700009)(122000001)(38100700002)(66556008)(19627405001)(52536014)(64756008)(4326008)(66446008)(54906003)(66476007)(71200400001)(316002)(55016003)(966005)(7696005)(110136005)(91956017)(76116006)(478600001)(66946007)(8936002)(8676002)(9686003)(53546011)(6506007)(26005)(83380400001)(1015004)(21615005);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?Pla+r9+15yPxEmaq+UfAgKmeMU9vJORzJd6QloPf624J2bQryqSLquaL0w?= =?iso-8859-1?Q?Dth1jgDHblmuRUOdINF6QH7pUE6PpesYV8040KR5tDsk7Nup8IK8n7oeMg?= =?iso-8859-1?Q?ggzISMsV0h9fCN81ULa0PERXDxNe0Oa8egFYwEtxxQW0kQyb4r4w+/VDin?= =?iso-8859-1?Q?QMjUQwYVzw+6A6AOw4cIcGuDiIBs15AcOwBPhqLg9/9b7gpMidLrpf2/eJ?= =?iso-8859-1?Q?n91Ea8YXFLGBX9qWUQUNb8g9BLPZM9rI6stW4tncfMiILKfQtO3ap+iCiv?= =?iso-8859-1?Q?xITTUFMMpqbf1r3Dh7wMyYn4fEgCjy5d9UVma28o3W/klnQxhgiRHqcmdr?= =?iso-8859-1?Q?abQ4Z3BLnOdCIPLSFRwae1FU2nZBs33v2CPHG9xKQNzqd4arhByte5LMt0?= =?iso-8859-1?Q?doCH6iye2fcapY4Urq/4i8QgISgGwA4nP2WXmjUAY1ZuUh7tyT0gd4qPyW?= =?iso-8859-1?Q?igMdYuA9IpmO3TAPXW1UgfgsPOFr9pQHxRE1eCLkhWVqtPE46bgT/BLzJ1?= =?iso-8859-1?Q?a2YyGxXoA5U70IKJKgPlD1yp5yVHxO/00OPfCx79oxST2FZ5L67wRXBTdx?= =?iso-8859-1?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wXPDshgbyB7NnUZ8?= =?iso-8859-1?Q?B+jss2HBCA1afFdYCMsNG+UMHxJeD64Nv4YM/PfCjsBI6v78K5sVeX7QpA?= =?iso-8859-1?Q?/cHG5cHAVwMyKk5cTOL8k2U4Q3kwlhslc8PLzY3A+3OnQZwd649tFtp6+O?= =?iso-8859-1?Q?6DsEBqTv21gnY=3D?= Content-Type: multipart/alternative; boundary="_000_BY5PR12MB4965D6A96F491762EC27095490692BY5PR12MB4965namp_" MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4965.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc188d59-bc82-4577-cd5e-08dc11af7bf0 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jan 2024 07:40:57.5938 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: b7nNcBKnaH/3KalgJ9zrcj7KSERBSBmespKynxrfcpxspNpjGEeRlWZmNTzb5UOgKWjl1u+Hl/au0hjdwVoaCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB6440 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 List-Id: --_000_BY5PR12MB4965D6A96F491762EC27095490692BY5PR12MB4965namp_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable [Public] Hi Abdul, Thank you for incorporating the comments. A few suggestions/ comments wrt t= he new functionality of skipping the stack frames with the 'bt' and 'finish= ' commands below. * Shouldn't the frame skipping be done for the 'return' command also ? * Shouldn't the frame skipping be enabled for the MI command '-stack-li= st-frames' also ? * The frame skipping does not seem to be working correctly for the 'bac= ktrace -n' command (to list 'n' nbr of the outermost frames). * As of now, there does not seem to be a way to turn off the filtering = of the trampoline frames. Shouldn't there be one ? * One suggestion for the trampoline frame filtering is to piggyback on = the current python frame filtering (plus FrameDecorator) mechanism. This mi= ght mean including adding a filter for this to the current source. This wou= ld enable users to use the existing commands to turn off frame filtering. B= ut this is just a suggestion, and it would be good to go by what the mainta= iners say wrt this. Thanks, Jini. ________________________________ From: Ijaz, Abdul B Sent: Thursday, December 28, 2023 17:00 To: gdb-patches@sourceware.org Cc: George, Jini Susan ; tom@tromey.com ; eliz@gnu.org ; blarsen@redhat.com Subject: RE: [PING 3][PATCH v5 0/4] GDB support for DW_AT_trampoline Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding. Ping! Best Regards Abdul Basit -----Original Message----- From: Ijaz, Abdul B Sent: Wednesday, September 27, 2023 11:05 PM To: 'gdb-patches@sourceware.org' Cc: 'JiniSusan.George@amd.com' ; 'tom@tromey.com'= ; 'eliz@gnu.org' ; 'blarsen@redhat.com' Subject: RE: [PING 2][PATCH v5 0/4] GDB support for DW_AT_trampoline Ping! Thanks & Best Regards Abdul Basit -----Original Message----- From: Ijaz, Abdul B Sent: Sunday, September 3, 2023 9:14 PM To: gdb-patches@sourceware.org Cc: JiniSusan.George@amd.com; tom@tromey.com; eliz@gnu.org; blarsen@redhat.= com Subject: RE: [PING][PATCH v5 0/4] GDB support for DW_AT_trampoline Ping! Best Regards Abdul Basit -----Original Message----- From: Ijaz, Abdul B Sent: Wednesday, August 16, 2023 11:54 PM To: gdb-patches@sourceware.org Cc: Ijaz, Abdul B ; JiniSusan.George@amd.com; tom@t= romey.com; eliz@gnu.org; blarsen@redhat.com Subject: [PATCH v5 0/4] GDB support for DW_AT_trampoline From: "Ijaz, Abdul B" Hi, please find attached a series of patches that attempts to enable GDB to han= dle the DW_AT_trampoline attribute on functions and inlined functions. DW_AT_trampoline can be emitted by the compiler for functions that are comp= iler generated trampolines (e.g. wrapping other function calls). In doing so, the compiler can specify a target as the value of DW_AT_trampo= line which the trampoline is wrapping. This series enables GDB to recognize the DW_AT_trampoline and store the tar= get for a given function. Patch 3 adapts GDB's stepping behavior when deal= ing with trampolines and attempts to - by default - hide these trampolines = from the user. When about to step into a trampoline, instead, GDB will try= and step through the trampoline and directly towards the target. Patch 4 = in V2 now skip trampoline frames in the stack for printing or finish comman= d. A new setting has been introduced to turn off this modified stepping be= havior or printing of stack for trampolines. The motivation for these patches comes from ifx which emits the attribute f= or some of its compiler generated functions. As I do not know of any other= compiler (especially gcc/gfortran) emitting DW_AT_trampoline, I added a gd= b.dwarf2 test to this series in order to test the trampoline handling withi= n GDB. Changes since V4: * Fixed reverse finish for trampolines. * Elide trampoline frames in backtrace for frame-filters case. * Use target subroutine address instead of name in case of ref type trampoline target. * Fixed loops formatting and now split line where possible at ";". V4 series of patches can be found here: https://sourceware.org/pipermail/gdb-patches/2023-August/201263.html No regression seen on testing x64/native-extended-gdbserver(-m32)/x32/ native-gdbserver test configurations for these changes using Ubuntu 22. Thanks & Best Regards Abdul Basit Abdul Basit Ijaz (1): gdb: Skip trampoline frames in the stack for printing or finish command. Nils-Christian Kempke (3): gdb, dwarf: add support for DW_AT_trampoline in DWARF reader gdb/symtab: add lookup for trampoline functions gdb/infrun: handle stepping through functions with DW_AT_trampoline gdb/NEWS | 15 ++ gdb/doc/gdb.texinfo | 47 ++++ gdb/dwarf2/read.c | 46 +++- gdb/gdbtypes.c | 34 ++- gdb/gdbtypes.h | 113 +++++++- gdb/infcmd.c | 13 + gdb/infrun.c | 93 ++++++- gdb/infrun.h | 10 + gdb/python/py-frame.c | 15 ++ gdb/stack.c | 8 + gdb/symtab.c | 80 ++++++ gdb/symtab.h | 19 ++ .../gdb.dwarf2/dw2-function-trampolines.c | 80 ++++++ .../gdb.dwarf2/dw2-function-trampolines.exp | 245 ++++++++++++++++++ gdb/testsuite/gdb.fortran/func-trampoline.exp | 69 +++++ gdb/testsuite/gdb.fortran/func-trampoline.f90 | 39 +++ .../gdb.fortran/mixed-lang-stack.exp | 10 +- 17 files changed, 922 insertions(+), 14 deletions(-) create mode 100644 g= db/testsuite/gdb.dwarf2/dw2-function-trampolines.c create mode 100644 gdb/testsuite/gdb.dwarf2/dw2-function-trampolines.exp create mode 100644 gdb/testsuite/gdb.fortran/func-trampoline.exp create mode 100644 gdb/testsuite/gdb.fortran/func-trampoline.f90 -- 2.34.1 Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928 --_000_BY5PR12MB4965D6A96F491762EC27095490692BY5PR12MB4965namp_--