From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IATcETQArmC6FwAAWB0awg (envelope-from ) for ; Wed, 26 May 2021 04:00:52 -0400 Received: by simark.ca (Postfix, from userid 112) id 425AB1F11C; Wed, 26 May 2021 04:00:52 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id CE11E1E783 for ; Wed, 26 May 2021 04:00:49 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8B10A3857828; Wed, 26 May 2021 08:00:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8B10A3857828 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1622016049; bh=OHkHsDJSRG8k9oKSNbfj1EcVpHupyTql3922IKZ5hO0=; h=To:Subject:Date:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=gyGSsBcDKdc6mTmJHDkBdiMDu03X+fO+C5mz8qJnvca99gE3hCBZaezikm2OGA1pS KOQiiBTXgHahXvwtQeeYT6o6lduelpyNFl2BJ8jkyW3t6SIUWuDdOtoRZWWnLkP2jL 4s+idqGR1wV+XeuEklQf5Hlx49wQZvLLIbi7QSvU= Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2089.outbound.protection.outlook.com [40.107.220.89]) by sourceware.org (Postfix) with ESMTPS id 983E43857828 for ; Wed, 26 May 2021 08:00:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 983E43857828 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G6Yp3MGqD4fiMZHxZw0lBKdXqC5duLcK7XXyL5L/2OHxlJrPeeh3w6osGD0+VjWZHx04y+cm2OvjgNcX5dS37CgtblllzgT3LehXImC7dJSd+BUVSrM/1DCtSBUdq2UM9XXIzaUsaQt0xogCvc1zUU/Hm1gigx6z5POTL48N6ekV2MX74NUJ8mJCcO5KfkxYKOs68TKx1cbDJAt9zZKoY4U2hvTYp0DktXSEoamhVjb80lqpdzOxesX/N4bvHo1kWo0dnaPAUqYtmlih/zw0sHaFNEsl6rC3LKL8CZDpDlbFDUV6E38FBn1n5nyGJpyZKPOWzw+BsiEFAiYhBrBmTw== 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=h8KQV7omtTNcWCwRJZ+zTQrtwTzkMEcB5wxLkFw3Dzo=; b=OrtqRvfkazV4JVdPO6tlP2lQVEWiL4yONFrme4tcpelhaT+7iBe9vqI1ec1lqJQ3vrFk6VjrcvmW251Z17U5Pb5ic7rswEgAzmyOqCj8OAs1c1wMd10EYZ85opeb2sFLL8AFS9SLpxMzHRij+sqjdoFrDmG2M1mOp6L9PqrIgtDRXrjyZvkFq6ZorvRmeFgXH35rcKHqy1Zpn4S7CCp/QRH9YHWwLFZFedxJY87UCdpDFEk3vOMNHyCnc5rk+BrZkCcULQ9y9neGAUV4/GbkjYkqEv96frSzSAmufXRBMAXjTyisbijmRqbyAXMLvKsPmi2yMIf5JMTsLHuL3roDCw== 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 Received: from DM5PR12MB1450.namprd12.prod.outlook.com (2603:10b6:4:3::8) by DM6PR12MB4353.namprd12.prod.outlook.com (2603:10b6:5:2a6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.26; Wed, 26 May 2021 08:00:43 +0000 Received: from DM5PR12MB1450.namprd12.prod.outlook.com ([fe80::ec05:c009:c3be:d2e2]) by DM5PR12MB1450.namprd12.prod.outlook.com ([fe80::ec05:c009:c3be:d2e2%6]) with mapi id 15.20.4150.027; Wed, 26 May 2021 08:00:43 +0000 To: "gdb-patches@sourceware.org" Subject: RE: [PATCH] [gdb.base] Add additional next commands for clang-12 and above in foll-exec.exp Thread-Topic: [PATCH] [gdb.base] Add additional next commands for clang-12 and above in foll-exec.exp Thread-Index: AdcyLoQ1lkRAo39xTB+he/vftbq7zALcE26ABRmPu8A= Date: Wed, 26 May 2021 08:00:42 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Enabled=true; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_SetDate=2021-05-26T08:00:34Z; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Method=Standard; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_Name=Internal Use Only - Unrestricted; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_ActionId=4c9160ce-1b27-47fd-9f97-947267accc67; MSIP_Label_76546daa-41b6-470c-bb85-f6f40f044d7f_ContentBits=1 msip_justification: I confirm the recipients are approved for sharing this content x-originating-ip: [165.204.140.250] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d0acac75-dbaf-4b7b-004f-08d9201c5c79 x-ms-traffictypediagnostic: DM6PR12MB4353: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ksjAjFhdS+VwadTPjIItfR9emLhBQq+DXcZouj0xH1dpUcCpkF+WPhgnBPk2ubXXuoBY2UViyQIeCqFJkZZjHXdvjZbOswfS+wnH5Fr6agPKT7BJxF9unpet3fZjn5ZgD2J4kSs3HwcqFlGKZhLOdgE+plXfQa3Llg8v7PEZJ4ViTsDaxns3azrS88Qvo++dNY9m0ECVi9P/9wcqtZ/29q6kxKNi+ThfFa7sBUNjIYIQPxYGTYcMRXLL+jmKFmqY+GUFaELVOhNSEP184KUW5pJUL95DIcw7aSvcfiS+2YZnvK/s5KlqFyYUbyAHfopqZgzlNmR1jsaXEuW7cO0u7ksRV0Dvzay4k3ZF+WrUa+EFBLZ0W3aJMV47Kr6+nzMtrPi4+6E0ssm42NviKkIXOI3sZHKsGQpVyR/CmiolHLn+Py94kz63UK4TVqeRXXJGo+uK1sQQ24PypOZg6qOAHIGjo/xD8L3jcoVmz2OnrlZ+xuL198yuZsrTd0yLZNa29+chWg7cQ994kV3B3jU8SlQNlZPOhnaeCBcpl0+IdxGJsBEP2vKxZEB4FiPaH339CArgN1ERRQUIMSv4pS+DMxOMxOWmiEPnfs3m8rVQNkeunGsP9akmxETX9xug0vsG34MaaZHfahI5Gil78L2u6hVcgsDm+tsp+ec3Kex+z0lzMciOoQL+4qDL/8u9zga6ZZBbQLVHhNTeoyfIUS+cyZUM7Iu/QUyL6HT45ZOTCrs= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM5PR12MB1450.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(33656002)(64756008)(66946007)(498600001)(71200400001)(53546011)(6506007)(76116006)(7696005)(66476007)(38100700002)(6916009)(26005)(54906003)(66556008)(122000001)(9686003)(52536014)(5660300002)(55016002)(8936002)(166002)(86362001)(66446008)(186003)(8676002)(4326008)(2906002)(83380400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?wEnAgOKE8OTHkBPGhlJIQav+9OJHhke7KVtKoOp95drOhLE+zTgP7nopcAhK?= =?us-ascii?Q?JYg9p9TDEcXlrTjX9Q/GKgI/hUnuUSCHilr+Xkkyp0VRivzTR65sFVHP4xv7?= =?us-ascii?Q?iYUtMWIz+1swEggqtUv1xAO1jHjDZzj9wznj96J+c/R0XOGN69cFJxYZmPIi?= =?us-ascii?Q?kYej9lCkFRFJQ7goQhJrnNo1ofY24jF43n4BujNU5W44tNjskwACudfMGqF8?= =?us-ascii?Q?YZRqMkRYDcaPc0y1BUcK7SrnVY+innV+u+gNp5sMCJPT6MviDN47T64bdttU?= =?us-ascii?Q?gfNAnuoVPIR3YygSF2Jz6J3GP6ctY4HSBRotivqHoPep1jo7/jqEjVsmaOcq?= =?us-ascii?Q?J17r7tDPQFWSexv9xENuY9vqyn/6IkoqU5T39F4OtW0aJqpoLta9Z/iV6bjC?= =?us-ascii?Q?hQ5+/RTB8X0rxo+LyVVZyHoZFyQ6M7WPBAyo6HOIBZk2rMY6el1d9g8y0B2s?= =?us-ascii?Q?jZ92cjzBIzDi0nPGdazNqNQzLXm5AEBolCQ6aPUsCjOypbj6svOBmA/ZCCSj?= =?us-ascii?Q?vR2p6F56tKpCN53UyD3qELOdfup/fEGUg+tdw1633/LmqxKDo4sch1JMbj7A?= =?us-ascii?Q?P8tOt1rBO6KJ00jGmczg9cZlqeCebNO41rpsAGlMta6F+eocbwhN7DHkuItB?= =?us-ascii?Q?9HQGWujmp5LgdQVhZOohsETGxa0YWni5FJPBbhz6YJGqwsSA0N/1Z+siPigQ?= =?us-ascii?Q?7O36F4e6xp1WuGSryefubbd1HuBjoVRXN8JgaDmRg0j+es7gffARd3ZsxvFg?= =?us-ascii?Q?4BDGETC1H+yiZTVilinUrgOxeOjLyGZfcGJ3kg9flHN51umLcQb3W0g54xcF?= =?us-ascii?Q?cTIXehG1BFsDlaJub0xBqMu6wTKzH6TKm7dnCABwFV0V2/E+SxofjOE1lIRw?= =?us-ascii?Q?Ht7DPz2zPXN4ObF6URjg2nSOt985EQlY4TW5im91eSM2CUhut3y2dWdb4Dj0?= =?us-ascii?Q?8Wf6D0ceMRJW0LWvfQJl9yioNGET3oTnlg+toK2gWjbKTkPzA6TFse5546hi?= =?us-ascii?Q?tJczqetDCpi87KiNSp4ry55ywvKnFNeKrV8Y8enMkDPqvYyw6HnmK+cBEfEp?= =?us-ascii?Q?/B9yEspME8ISTc/X3ghQHVyylgJKMxS/PhtW9KEEQM3o3tEp6zdzVbY9+dy5?= =?us-ascii?Q?zVgLpwBr7yYU8miKSrx23H26qF9ULZ+o+Hvi66p7JVMaQZm9oPnv0YXUbIij?= =?us-ascii?Q?LCDQxbk/Psj0gCIu1FYq0vi/U47atv4L6pQkMN84CjWjqb2yw4JJuK9CtHGm?= =?us-ascii?Q?HHC+V0xaWk7FOgDfgT14riiIgd1Xbwr3yxa9+H4xJa/NDw+bLTs2Fkv0rZ7I?= =?us-ascii?Q?T958H5EfRfuNzXYD7SvIqVgc?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM5PR12MB1450.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d0acac75-dbaf-4b7b-004f-08d9201c5c79 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 May 2021 08:00:42.9384 (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: gjpLZMhLdnv8frUjbRmIVJpnEFAxYhlxxiOIMZTHlWxfr0wfMj9hxT43zXp1oDo+y0F26XeuN8H+62I/w8X21A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4353 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: "Kumar N, Bhuvanendra via Gdb-patches" Reply-To: "Kumar N, Bhuvanendra" Cc: "George, Jini Susan" , "Achra, Nitika" , "Sharma, Alok Kumar" , "E, Nagajyothi" , "Tomar, Sourabh Singh" Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" [AMD Official Use Only - Internal Distribution Only] Hello all, Gentle Ping 2! Please let me know if any additional information or discussion is required,= thanks in advance This test case change is important for clang. regards, bhuvan From: Kumar N, Bhuvanendra Sent: Friday, April 30, 2021 2:30 PM To: gdb-patches@sourceware.org Cc: George, Jini Susan ; Sharma, Alok Kumar ; Achra, Nitika ; Tomar, Sourabh= Singh ; E, Nagajyothi Subject: RE: [PATCH] [gdb.base] Add additional next commands for clang-12 a= nd above in foll-exec.exp [AMD Official Use Only - Internal Distribution Only] Hello all, Gentle Ping! Please let me know if any additional information or discussion is required,= thanks in advance This test case change is important for clang. Regards, bhuvan From: Kumar N, Bhuvanendra Sent: Friday, April 16, 2021 1:07 AM To: gdb-patches@sourceware.org Cc: George, Jini Susan >; Sharma, Alok Kumar >; Achra, Nitika >; Tomar, Sourabh Singh >; E, Nagajyothi > Subject: [PATCH] [gdb.base] Add additional next commands for clang-12 and a= bove in foll-exec.exp [AMD Official Use Only - Internal Distribution Only] Hello All, I request all of you to please review this patch. Below are the details. Problem Description: Following 8 test points started to fail after the clang patch(https://revie= ws.llvm.org/D91734). FAIL: gdb.base/foll-exec.exp: step through execlp call FAIL: gdb.base/foll-exec.exp: step after execlp call FAIL: gdb.base/foll-exec.exp: print execd-program/global_i (after execlp) FAIL: gdb.base/foll-exec.exp: print execd-program/local_j (after execlp) FAIL: gdb.base/foll-exec.exp: print follow-exec/local_k (after execlp) FAIL: gdb.base/foll-exec.exp: step through execl call FAIL: gdb.base/foll-exec.exp: step after execl call FAIL: gdb.base/foll-exec.exp: print execd-program/local_j (after execl) Resolution: These comments in the clang patch(https://reviews.llvm.org/D91734) explain/= address the issue : ". . .the test is trying to "next" over a function call; gcc attributes all= parameter evaluation to the function name, while clang will attribute each= parameter to its own location. And when the parameters span multiple sourc= e lines, the is_stmt heuristic kicks in, so we stop on each line with actua= l parameters. This is not ideal IMO; I'd rather be more principled about (a) stop at ever= y parameter, or (b) stop at no parameters. But without reworking how we do = is_stmt, I think fiddling the test to do enough single-steps to actually ge= t past the function call is okay." After this clang patch, we can see additional .debug_line entries created w= hile handling the function call and parameter evaluation as mentioned in th= e commit message. Hence to suit the new clang behavior, its suggested to mo= dify the test case for clang-12 and above. Thanks and Regards, Bhuvan Patch content inlined: >From b6c3646cdd40fae679131107a0b2be4ff5b9eae5 Mon Sep 17 00:00:00 2001 From: =3D?UTF-8?q?=3DE2=3D80=3D9Cbhkumarn=3DE2=3D80=3D9D?=3D Bhuvanendra.Ku= marN@amd.com Date: Fri, 16 Apr 2021 00:18:07 +0530 Subject: [PATCH] [gdb.base] Additional next commands added for clang-12 and above. After this clang patch(https://reviews.llvm.org/D91734), 8 test points started to FAIL in this test case. As mentioned in this PR, "...this test is trying to "next" over a function call; gcc attributes all parameter evaluation to the function name, while clang will attribute each parameter to its own location. And when the parameters span across multiple source lines, the is_stmt heuristic kicks in, so we stop on each line with actual parameters...". We can see additional .debug_line entries getting created after this clang patch, hence the test case is modified accordingly to suit the new clang behavior. This test case modification is required for clang-12 and above. Line table: (before clang patch for the below code snippet) : 0x000000b0: 84 address +=3D 8, line +=3D 2 0x000000000020196a 42 3 1 0 0 0x000000b1: 08 DW_LNS_const_add_pc (0x0000000000000011) 0x000000b2: 41 address +=3D 3, line +=3D 5 0x000000000020197e 47 3 1 0 0 Line table: (after clang patch for the below code snippet) : 0x000000b5: 84 address +=3D 8, line +=3D 2 0x0000000000201958 42 11 1 0 0 0x000000b6: 05 DW_LNS_set_column (4) 0x000000b8: 75 address +=3D 7, line +=3D 1 0x000000000020195f 43 4 1 0 0 0x000000b9: 05 DW_LNS_set_column (3) 0x000000bb: 73 address +=3D 7, line +=3D -1 0x0000000000201966 42 3 1 0 0 0x000000bc: 08 DW_LNS_const_add_pc (0x0000000000000011) 0x000000bd: 4f address +=3D 4, line +=3D 5 0x000000000020197b 47 3 1 0 0 gdb.base/foll-exec.c test file snippet : . . . 42 execlp (prog, /* tbreak-execlp */ 43 prog, 44 "execlp arg1 from foll-exec", 45 (char *) 0); 46 47 printf ("foll-exec is about to execl(execd-prog)...\n"); Following 8 test points started to fail after the above clang patch. FAIL: gdb.base/foll-exec.exp: step through execlp call FAIL: gdb.base/foll-exec.exp: step after execlp call FAIL: gdb.base/foll-exec.exp: print execd-program/global_i (after execlp) FAIL: gdb.base/foll-exec.exp: print execd-program/local_j (after execlp) FAIL: gdb.base/foll-exec.exp: print follow-exec/local_k (after execlp) FAIL: gdb.base/foll-exec.exp: step through execl call FAIL: gdb.base/foll-exec.exp: step after execl call FAIL: gdb.base/foll-exec.exp: print execd-program/local_j (after execl) gdb/testsuite/ChangeLog: * gdb.base/foll-exec.exp: Additional next commands added for clang-12 and above. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.base/foll-exec.exp | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 52b0752276..ad289c135d 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2021-04-16 Bhuvanendra Kumar Bhuvanendra.KumarN@amd.com + + * gdb.base/foll-exec.exp: Additional next commands added for + clang-12 and above. + 2021-02-12 Andrew Burgess andrew.burgess@embecosm.com * gdb.fortran/allocated.exp: New file. diff --git a/gdb/testsuite/gdb.base/foll-exec.exp b/gdb/testsuite/gdb.base/= foll-exec.exp index 6d5e21f54d..8b1fa42db9 100644 --- a/gdb/testsuite/gdb.base/foll-exec.exp +++ b/gdb/testsuite/gdb.base/foll-exec.exp @@ -118,7 +118,14 @@ proc do_exec_tests {} { # We should stop in execd-program, at its first statement. # set execd_line [gdb_get_line_number "after-exec" $srcfile2] - send_gdb "next\n" + # Clang-12 and above will emit extra .debug_line entries when + # parameters span across multiple source lines, hence additional + # next commands were added. + if {[test_compiler_info {clang-1[2-9]-*}]} { + send_gdb "next 3\n" + } else { + send_gdb "next\n" + } gdb_expect { -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:${execd_line= }.*int local_j =3D argc;.*$gdb_prompt $"\ {pass "step through execlp call"} @@ -269,7 +276,11 @@ proc do_exec_tests {} { # the newly-exec'd program, not after the remaining step-count # reaches zero. # - send_gdb "next 2\n" + if {[test_compiler_info {clang-1[2-9]-*}]} { + send_gdb "next 3\n" + } else { + send_gdb "next 2\n" + } gdb_expect { -re ".*xecuting new program: .*${testfile2}.*${srcfile2}:${execd_line= }.*int local_j =3D argc;.*$gdb_prompt $"\ {pass "step through execl call"} -- 2.17.1