From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Wv/gNf7Gi2BXXwAAWB0awg (envelope-from ) for ; Fri, 30 Apr 2021 04:59:42 -0400 Received: by simark.ca (Postfix, from userid 112) id CDFBA1F11C; Fri, 30 Apr 2021 04:59:42 -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 1C4971E783 for ; Fri, 30 Apr 2021 04:59:41 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9635B39888A1; Fri, 30 Apr 2021 08:59:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9635B39888A1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619773180; bh=ntelPmvr0PEvWkAau8YZTTTdOoE9aGRzyRzgEheO6IA=; 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=XqByopyeahitNOl9fhXybPA1PG9Q3vOvocPvs7CK1tFs62SGlS3vYpsBKTXvH2IQq qfFxHfmFeZ5loSlZUDYUMk6u55CPvbzxF11UEi0qwjb2rg8YbKw/ytnx6ntQieKr2y qxyeDlfAgzo9IKcAttwvP1AfgKp1cBHC+7i5gmik= Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2087.outbound.protection.outlook.com [40.107.220.87]) by sourceware.org (Postfix) with ESMTPS id A11963854805 for ; Fri, 30 Apr 2021 08:59:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A11963854805 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=il5OlnV9U1iuLmfscp5RR5mPC81AYF/fsMEcrqEiEbl7INfYOIY1SJK34ea/wZhy59TKGeY56xUT5SKXQz8c0MnZ82qJ+YVlUCJxF4OZ7jqHbUNkn5tVdCTJtqsUkeAqOe3WVyhs19u2DHlzUY0T3UCP9pe2YV3w5jk0JmTra5bfDc7uoZPlM1geU0j+vNY3J+DfSM7ui2FJyD3OlrWcnV9ofrWAd+zPlAfNp1I8P9W5GOBiv5dn8EPHDjiJIscbcp0HEFJ2rFmECHLErCxWBd00u2l39d/qqB8k4LvMOM+wVroak39R5hbc7/1rf2GWAirnX4wVGxkDAlMSUjUomA== 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=LcJEQKbTCHTW6Glx3fRIk6MGuICV5+ETjwpHtXMuV1g=; b=dUY5yoFTgsI12b41pOSzDRlWDMViHZM+x0msM5oMWSGOI9R4TYy6RRFR28q2vETs43m+qweTEsgj08oJWrGmMPEuwkgIxnwN/GuWfRI6Uz31pIt1uhmCVsz8ASqwc9+C+qkjCtkxizR3yHIh+T/BK7LPSVVE3Sb8kEOyym3B+9JMyoh+ALqlFBxSWs2Hp5CQD/zdh6/CKkls2TvAmj5vnebQiBWROcs7y4+y60z9qAj+uixiytjphJYQmrylByNNOiHYYP8krTQJqez8Pz2e6iI7wvslLvoD0d7B8JL4V4hzhq+a4J8baou5AOxIXJdlmKVK9Z8WwjmdYbLcgLW+CQ== 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 DM6PR12MB4220.namprd12.prod.outlook.com (2603:10b6:5:21d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.20; Fri, 30 Apr 2021 08:59:34 +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.4065.029; Fri, 30 Apr 2021 08:59:34 +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/vftbq7zALcE26A Date: Fri, 30 Apr 2021 08:59:34 +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-04-30T08:59:23Z; 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.134.249] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7e3c1094-9ac0-459b-5abc-08d90bb646b1 x-ms-traffictypediagnostic: DM6PR12MB4220: 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: VNYhPzQD1GDy4p02fITq8rf2se2mUINh5bn/6uCmEW2wSNq5MvzwOsLq3yK3u843434oHwXaUbegdXSxp384pYmbjwoWBL/BTXePNGRXRQ3sr6kaaAfMxfALj3EnfKVkeFkNU6pB58zZOtpVTKW+ITx3gaTqcyNLzxtHD0x7UyCGruppUtKv5nJ+r6kLyXIvNtUJaA/xG+x9zh6QlBie+1m1DizulzvyehZy7+K8kU2x6MK3qHCkdzHhNO9Tfb+aCTP/PMm5+g7757a9YM/SWynDjlPrBiZw9lWwzoecmGxFFm4x3HwSBuVPdum9yf3Wi2hqcGWW/xdHu7/+uTjDkfRt+DOsg9KfkmcEcSsudp8cDhf0SCI8X5trKsUm8GMxjCGt5MZbwgOtr+I5kyQRrzNFe7ubhvI3QAvlTzSFJybQxqqNS7VJvdeVzjkPRYv1/UHtDwnTOmkS8SEEbuaH+EPS8S7GXzZi8ui9E0+Wf7d+nxISv6LxTlNKzDZm+Ur7+PwfB3RRUM1N4UtGOjnNeKpZu/3HQeyJ6T1xqVonn1JcoeH7uPcyHg+QQBWBReRruqtM5rx/R+9kSzaymSuldkEswh+id1G+4tZikFywKckpGVU7Qhod2a9Gnt5AtW3828HQpHcacQInIvWqfVIfsakOUnTS0DngnWn7lOaLc9hG66WnWyl70d5imR7ot7jI 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)(346002)(136003)(376002)(366004)(396003)(39860400002)(186003)(26005)(52536014)(38100700002)(2906002)(5660300002)(86362001)(33656002)(7696005)(478600001)(53546011)(8676002)(6506007)(8936002)(54906003)(4326008)(122000001)(166002)(83380400001)(6916009)(66446008)(66476007)(9686003)(64756008)(55016002)(71200400001)(66946007)(76116006)(66556008)(316002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?aLpSK8u4WILN5Dlkr3J6ru92lvqLzUlpiaOF7cZL1bOFQySD4FyQ2MGc0ZP5?= =?us-ascii?Q?HEW70ziRIPBeDSq2PHlaOv6aqNQFwTkHV98wZwxPGDAA1GePyQSLi8qKc04K?= =?us-ascii?Q?HxWUF0iFHi2Aif4NQpotxxrC0M7I6ctlNDVslBKhoZzQUZrYDN+zqzGGkOeH?= =?us-ascii?Q?iUjvWWL5DUXAlV0V5CaxErVdywnnWVa7xcMlY31YSIMq/2UiTW8mJedBrCQg?= =?us-ascii?Q?lHbpgdBx1xNB0f+ktRhvAYZwDQeck9ojlxi2Pzr1H1v5i1o6fjhtsH82oF4g?= =?us-ascii?Q?zbp1V8BNcJ9R7X2E7JJAvTE5l4LX5ri4MGxnIJBghqgcXlxiA3KYCBSfnKru?= =?us-ascii?Q?7Lhj2L8Cbf+mkzScob/BftOYUt52hpYwXELmtSclpIoIRhuFnxBafUwmn7zx?= =?us-ascii?Q?earkwr5i6S8AzRY+nSChbI9nciTBl8I8HfG8qXQm6AHqoavKfFYrhhUDjNO8?= =?us-ascii?Q?W94//pBVuZCsHZHkqtiHCwLhTI/j32rjpDqDIfI0wvzdJxNjUJcZOEHRX8Lq?= =?us-ascii?Q?nxEyO+98lyJjKzhKaix/WtOL91eN2bIdRz3Ax5kTGFVdrLhqA30O6rC1RTO6?= =?us-ascii?Q?nlx7ODrc4G1xELtXqtSviu9/iSKNnegj9iRLG/nrLhzfyWgJQxCu8O2JXaz+?= =?us-ascii?Q?GI9zhJ2+B97NdX6LgmdTbVjseUHML16GqcvQmCTMGgyCg6Z1nwf7oozz5E9K?= =?us-ascii?Q?LEm3+TjPoc6Rs23DbPk7wlFJwq9fmYzoiYAZ4Xya/fwPsjEAMf4X3VmMPHo3?= =?us-ascii?Q?OfFMMFvWKu0x+EcGXnMPdssG8cXtunbiavqrlX39gDwgGQbquVktOYIKhrUb?= =?us-ascii?Q?z93q8s5VX7eLAU+2wMjL93Xve1h/dHqvU94ZWFn/VCTFhxAscCmvkoCb25cq?= =?us-ascii?Q?WFqiKptuwO/3JQyK/Y8SqBxA8OxiggRXed1SDvAbbzwkWa+FbI41MdeRFPks?= =?us-ascii?Q?1itlTIEWfxWMJ5ND0xXKcxD+CWEPin2eVJuEpFafrtaMEvy4i2//7fA6Oel9?= =?us-ascii?Q?jdxdpbKdqteQXws9za9tT6nA+M+9Zq7+B9gdp6voDJK9TGO+LxbNttMl+fBe?= =?us-ascii?Q?zu5PknJ7qC/Ejf4IPpzHez52Fo5+tDHdBXs2n5ZPIliIeA3t4Yz4uxgVcD5g?= =?us-ascii?Q?PJ72qq2d0lPFrKpEZxAefjKdtRV9GSTkCKHvo1PPEpagR4ZpJhvoCPq9PECN?= =?us-ascii?Q?cBTx8JS2pc/IUIQ2dI5HwVHniY60YNfXmnW38ZnSd/3PQH9nNuDg5LgIfHHh?= =?us-ascii?Q?FzaX9Agx6VHUPS2kequ5LXxGx9iXR2htS7M2UbStdxJtbOHIuXXjNF8tqhLs?= =?us-ascii?Q?rvgvK/AdohFJFp5Ni4iI9Z1S?= 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: 7e3c1094-9ac0-459b-5abc-08d90bb646b1 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2021 08:59:34.3769 (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: W5tb364svuCxsH5PvmCi9PMDyxI1kVGowlmX/zB/kZfrUAAb0T1MkfnWQlR0za28ZJ43FPJ1D+9mMsG/CK2HCA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4220 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! 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