From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18360 invoked by alias); 22 Jan 2020 16:42:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 18275 invoked by uid 89); 22 Jan 2020 16:42:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-13.8 required=5.0 tests=AWL,BAYES_00,FORGED_SPF_HELO,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,UNPARSEABLE_RELAY autolearn=no version=3.3.1 spammy= X-HELO: EUR01-HE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr130052.outbound.protection.outlook.com (HELO EUR01-HE1-obe.outbound.protection.outlook.com) (40.107.13.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 22 Jan 2020 16:42:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g4IKOMN5LcI4SMUFWc1n6ywJQo3U9AMMPvqiY6QZ/TI=; b=o6I2TqUY66jHvFS1qnsRgCbjAFyKnmAK+gqrn9X/WAZyOUP8Z3h44Eb5/3olPJ83hGKcof6bl6bpatsqwuky2Va6TOtDpAuJXnT1MBR6p5PJ4Dopw7K+DWastzXgh/Lg68gP+CJeQQFW2ZIIBhUXpVtpw5q+qXq5hAGUyYGKg+Y= Received: from VI1PR08CA0274.eurprd08.prod.outlook.com (2603:10a6:803:dc::47) by AM5PR0801MB1876.eurprd08.prod.outlook.com (2603:10a6:203:42::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 22 Jan 2020 16:42:08 +0000 Received: from DB5EUR03FT032.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::202) by VI1PR08CA0274.outlook.office365.com (2603:10a6:803:dc::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19 via Frontend Transport; Wed, 22 Jan 2020 16:42:08 +0000 Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;sourceware.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT032.mail.protection.outlook.com (10.152.20.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2665.18 via Frontend Transport; Wed, 22 Jan 2020 16:42:08 +0000 Received: ("Tessian outbound 0eaff1016ea4:v40"); Wed, 22 Jan 2020 16:42:07 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6745ffeddd863586 X-CR-MTA-TID: 64aa7808 Received: from 0f3dfdee0ac0.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 5CB3D6EA-C483-4BBF-8A53-FCE269612C15.1; Wed, 22 Jan 2020 16:42:02 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0f3dfdee0ac0.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 22 Jan 2020 16:42:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HV0ogqJvtqxMX4r6Jam6773bNHq8Cc91JwLZ9Lt5jK1T07QszFCSyRocxb+cTn8X4DhM1XcOjNJfI+fUH1Ee64delAFcX+1wKP7O1qIdTTS5efVrxgnmj0KfZBsy/YlwaMx9RsHdboJFd1jPDENElhYOW482eIcc8BhoWH8yg/qVkFzbR3k6OXHk5NYdRjVLOI6q2YYYVLdK4uOlpqzWYdvzLPtxIRhUY/79ykNfdkcIX3kmlw8qjDrsa+cZa7k8ELLJClBpBXMlmngAdYlrid1VEUBZCobgPSAJFdGdX5rOoWd0N0aw1D2kWuE6csoWc/sqRZV3+n3I0ChPYeF+rg== 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=g4IKOMN5LcI4SMUFWc1n6ywJQo3U9AMMPvqiY6QZ/TI=; b=GdmOlm9caZjUW5uy2C3s+f/JVJkGX6gUx5hJ3tWWUFSHdo0083fWl///ladfWM20jUZ+C7j3Wf8/pYHnBEG6VR7R2mC3OMJyr7IBA5opxVlUB6dCf0kcneKgZQSCvt5VOzlVx7OVERjtgMfhMKtgBwpgXW6nqj30yp5Arph6D6lgu7ageL0YJ99ZwfAjRrK9z+tv55ondd49KjhIJYK3zj5lciJzMLovMJc0NnDthcJ+i2MDPGdvz+AwUZd6+OCnGdUY4PHuwPWzjimxsb5U9n4rkiRksonizp1kl7O55L6TyqIDLncLr27C8etuQ75g53B9rCCn8JXxKX7QSGSpIw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g4IKOMN5LcI4SMUFWc1n6ywJQo3U9AMMPvqiY6QZ/TI=; b=o6I2TqUY66jHvFS1qnsRgCbjAFyKnmAK+gqrn9X/WAZyOUP8Z3h44Eb5/3olPJ83hGKcof6bl6bpatsqwuky2Va6TOtDpAuJXnT1MBR6p5PJ4Dopw7K+DWastzXgh/Lg68gP+CJeQQFW2ZIIBhUXpVtpw5q+qXq5hAGUyYGKg+Y= Received: from AM0PR08MB5330.eurprd08.prod.outlook.com (52.132.212.151) by AM0PR08MB3603.eurprd08.prod.outlook.com (20.177.110.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Wed, 22 Jan 2020 16:42:01 +0000 Received: from AM0PR08MB5330.eurprd08.prod.outlook.com ([fe80::89cf:a33e:c415:d30]) by AM0PR08MB5330.eurprd08.prod.outlook.com ([fe80::89cf:a33e:c415:d30%6]) with mapi id 15.20.2644.028; Wed, 22 Jan 2020 16:42:01 +0000 From: Alan Hayward To: Luis Machado CC: "gdb-patches\\@sourceware.org" , nd Subject: Re: [PING] [PATCH] Harden gdb.base/step-over-syscall.exp Date: Wed, 22 Jan 2020 17:06:00 -0000 Message-ID: References: <20200115203645.26360-1-luis.machado@linaro.org> <870ad1a6-c679-56c3-ea31-a7df80a048ce@linaro.org> In-Reply-To: <870ad1a6-c679-56c3-ea31-a7df80a048ce@linaro.org> Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:4714;OLM:4714; X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10001)(10009020)(4636009)(366004)(39860400002)(396003)(376002)(136003)(346002)(189003)(199004)(86362001)(6512007)(6916009)(6486002)(36756003)(5660300002)(26005)(66946007)(2616005)(76116006)(66476007)(91956017)(66556008)(2906002)(66446008)(186003)(64756008)(6506007)(4326008)(53546011)(81166006)(55236004)(478600001)(54906003)(81156014)(8936002)(71200400001)(966005)(316002)(8676002)(33656002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR08MB3603;H:AM0PR08MB5330.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 3ZavvxJ2mLfpklXTFOI/x4zBtNoypLQcImCUjie/P8Vd6+hhvrQ5iICpnYRM7ORst8bckhBYg4arfy2UcIsPgVp1v+HXrYCdwn2dilgB4IZ4bbdD7mgPBrH1h9yH+M4JndTnNi6623wjMSUDB0eeNY0iIuPN/mx9kAE8CaLxpTm4Wn3jI2+mDyopOEg1UmWg/NtYLa6EGpNcv0QYOBDD8MwPqKofiqPPqRj0MfvEd0j6ImHFTiJYVDpPSVr2WWQk/QfRZj6sQ8hdrUo3IL4BlfvBRPbJO1QbtTLs9vcgdNLrOaLn+jyeEqSbzmb3hEl9hlng+pnKeMEd0qaCZtdmvGBNd0Z2jXL/coEq8nECK1Ek7MSA9UNdSm/BhTZmxl/4aW1drfVPCJ0Ww9OFCGLHsh4BxA9HDRJgO5SSbev1/vpSfewCkVz/7/OXqjnDrjJOMe4pctCKnwcpYBdTYTKtnwYPrPYG1ly2ciZIThi7D5aK4sNF34I+SuHjFbwYGWN4dgHGJcl56EjppE2bfcxS1cWOSGs1d0kHFv9HkDJVR+E= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-ID: <6B83AD7BF9036E419EA2DE753C2D1A1F@eurprd08.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; Return-Path: Alan.Hayward@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT032.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b9850e76-f736-4ba0-816a-08d79f5a011a X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00682.txt.bz2 > On 22 Jan 2020, at 15:20, Luis Machado wrote: >=20 > On 1/22/20 11:26 AM, Alan Hayward wrote: >>> On 22 Jan 2020, at 13:30, Luis Machado wrote: >>>=20 >>> ping? >>>=20 >>> https://sourceware.org/ml/gdb-patches/2020-01/msg00432.html >>>=20 >>> On 1/15/20 5:36 PM, Luis Machado wrote: >>>>=20 >>>> + >>>> + set pc_after_stepi [get_hexadecimal_valueof "\$pc" "0" \ >>>> + "pc after stepi with x command"] >>>> + >>>> + if {$next_insn_addr !=3D $pc_after_stepi} { >>>> + fail "pc after stepi matches insn addr after syscall" >>>> + } >>>> + >>>> return [list $syscall_insn_addr [get_hexadecimal_valueof "\$pc" \ >>>> "0" "pc after stepi"]] >> Minor nit. In the return, you could just use $next_insn_addr instead of >> calling get_hexadecimal_valueof again. > >=20 > Do you mean $pc_after_stepi as opposed to $next_insn_addr? $pc_after_step= i is what we get from the $pc register. $next_insn_addr is what we get from= using the X command. Yes, $pc_after_stepi :) >=20 >>>> } >>>> @@ -156,8 +192,13 @@ proc step_over_syscall { syscall } { >>>> } >>>> } >>>> - gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, .*" \ >>>> - "continue to syscall insn $syscall" >>>> + # Check if the syscall breakpoint is at the syscall instruction >>>> + # address. If so, no need to continue, otherwise we will run the >>>> + # inferior to completion. >>>> + if {$syscall_insn_addr !=3D [get_hexadecimal_valueof "\$pc" "0"]= } { >>>> + gdb_test "continue" "Continuing\\..*Breakpoint \[0-9\]+, .*" \ >>>> + "continue to syscall insn $syscall" >>>> + } >>>> gdb_test_no_output "set displaced-stepping $displaced"