From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14675 invoked by alias); 21 Jan 2020 11:54:43 -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 14663 invoked by uid 89); 21 Jan 2020 11:54:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 spammy= X-HELO: EUR04-HE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr70088.outbound.protection.outlook.com (HELO EUR04-HE1-obe.outbound.protection.outlook.com) (40.107.7.88) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 21 Jan 2020 11:54:40 +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=RlyoV6eemQaYUlZFfAiSKYZJcAsRmXv3aa5QpFjtVKE=; b=rR6Y9W8DbfDkwssh+c8oML9TUtGoBWpWV4dqrR35lIPSrLXKxmHGZMNK+phoOg8x8fG7y26L6P1vnTwQAXxiyVsChSzOheNzqBdbje1MTkN/1GNhbvg/6Vt6PfvSKScK8kSrjZZe8BoXml9fU2RZAtvURplbXggPyQ/oKTuCZnk= Received: from VI1PR0801CA0085.eurprd08.prod.outlook.com (2603:10a6:800:7d::29) by VE1PR08MB4653.eurprd08.prod.outlook.com (2603:10a6:802:b1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.20; Tue, 21 Jan 2020 11:54:35 +0000 Received: from DB5EUR03FT062.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::208) by VI1PR0801CA0085.outlook.office365.com (2603:10a6:800:7d::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19 via Frontend Transport; Tue, 21 Jan 2020 11:54:35 +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 DB5EUR03FT062.mail.protection.outlook.com (10.152.20.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.23 via Frontend Transport; Tue, 21 Jan 2020 11:54:35 +0000 Received: ("Tessian outbound 1da651c29646:v40"); Tue, 21 Jan 2020 11:54:35 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7267a76b6ab639a9 X-CR-MTA-TID: 64aa7808 Received: from f50092c9ce4d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BD518BF2-FCAA-4A84-9550-11B5B370A131.1; Tue, 21 Jan 2020 11:54:29 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f50092c9ce4d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 21 Jan 2020 11:54:29 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dOjTAWykHvXd31ru6WzaAAqXFMDtZ/czDNtjoW4dGvEAd0i8ckhHH5K1hQa1axNJrySJGz483pibENtDW7/V5xGuUxRmdrmeFanXdpWaoIMbHYYuGwBIQF5rE4xuyXGGQwUuEgQl6Gs+/zWhL2q0YI5kT31qXxUXK3o4ZdxWQihM4tHItZeLZB27JfwA5mjY1iVukoAK/CjcZkZHJlZBU5blC2iKk+Z3hGHOWwOKL/PB4KCIjYGP5lpWIyASGGMrPdLAenG+oYBi/87Ecl8oMqMuWPGZbeHxVhhMXxZW/HTUcnS3kY7Ow1sTq9ykatO51Ighwoww9wed6FTohim6Yw== 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=RlyoV6eemQaYUlZFfAiSKYZJcAsRmXv3aa5QpFjtVKE=; b=Y/u9OmXMVxWNTynhxE6d+Jk88EIO4EOUBuT6jnWWBHtzat6MyTK/6WnDtseaVRNzh9wSkDkiVJf9qQH8MDdTmx7cpOcU47oTnWGTQUCwb2pgj6gCmSfJTZRww4XIbsTni5BDlJsVqmJgvgEZqxl0ywj7jU2wROk0Hr/dU4EEqAgrlJjpAjHPLRJSRRPUjX+5qbOjdohCiFhSrdKA8RDXNQakMKwZRrvcPFg+zYdHp8gVjr5oq/F/oGbaAfmU8T5xSUBXt6qbVq4KypX3KrbaCAOvlBY49Fs/jtO+n/Kyud5tn+gwnBVgIFcvnvLsyYvVKe92R87se8NeL2rVXRpuLQ== 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=RlyoV6eemQaYUlZFfAiSKYZJcAsRmXv3aa5QpFjtVKE=; b=rR6Y9W8DbfDkwssh+c8oML9TUtGoBWpWV4dqrR35lIPSrLXKxmHGZMNK+phoOg8x8fG7y26L6P1vnTwQAXxiyVsChSzOheNzqBdbje1MTkN/1GNhbvg/6Vt6PfvSKScK8kSrjZZe8BoXml9fU2RZAtvURplbXggPyQ/oKTuCZnk= Received: from AM0PR08MB5330.eurprd08.prod.outlook.com (52.132.212.151) by AM0PR08MB5490.eurprd08.prod.outlook.com (52.132.213.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2644.19; Tue, 21 Jan 2020 11:54:28 +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.027; Tue, 21 Jan 2020 11:54:28 +0000 From: Alan Hayward To: Luis Machado CC: "gdb-patches\\@sourceware.org" , Simon Marchi , "tankut.baris.aktemur@intel.com" , nd Subject: Re: [PATCH 2/2,v3] [AArch64] Test handling of additional brk instruction patterns Date: Tue, 21 Jan 2020 11:57:00 -0000 Message-ID: References: <20200115115137.17771-1-luis.machado@linaro.org> <20200115115137.17771-3-luis.machado@linaro.org> In-Reply-To: <20200115115137.17771-3-luis.machado@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:9508;OLM:9508; X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(4636009)(376002)(346002)(396003)(366004)(136003)(39860400002)(199004)(189003)(8676002)(81166006)(8936002)(81156014)(2616005)(26005)(36756003)(186003)(54906003)(33656002)(5660300002)(86362001)(4326008)(6506007)(6512007)(6916009)(6486002)(66946007)(66476007)(66446008)(64756008)(66556008)(478600001)(2906002)(316002)(55236004)(53546011)(71200400001)(91956017)(76116006)(142933001)(2004002);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR08MB5490;H:AM0PR08MB5330.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX: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: f9RVZAFaHy+4MgwFNbOMKvI6QoazaSdsPUULvRJPudol3YCGeWshtD8X0yTCtaVRcEa9HbHwJoIzjIQXY4xezZ3+nafa214dmMlpkn7zKvqoOo6w0JpfpngKrw8sLuxSAgVFP8A+c640DWTjdcD4TjJI5RaStUlJ47y9QyaIQ9gTJrVw68l/NKMcmabpSLBtXT1KSf6yPkZwCe7CCt9Jk7ojWcngYebPymW4OIcyF3k1CVQHv9P0Bt8kYvxhJOCmmJaZ0KFVn1wQlOsJoX9A7orNiUptzDtEPdkBHW8t+knLqztDJeszS21kfyBec9JEVoMwFHCZTyYkPDGwXRKvYCMhQ0+S1+xnvPvXLP+xlyiE4415/kuvYXckr+SdFAwNeWUDvurHAN9xPK6j3Mn6YhGcyQp4yDEz8kfP0dFdayT3rIRp8vIxy27udpXYAjx3TeDwILyXnJocjMCP3HCKu2rJik4VcfD2Zzt/gF5R25ZrqYpy+owR6YzGPPT8AR+6fIJm97nL06sezxbV0yI1bnQjuyHhBFpP04jRL0S0G6kUlP5pPQa0EEJ/n/ZqSkGf8Nq6AFWpmZ+8qgS4NwrGuA== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-ID: 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: DB5EUR03FT062.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 74228c34-c5bd-48db-262f-08d79e68ab49 X-IsSubscribed: yes X-SW-Source: 2020-01/txt/msg00631.txt.bz2 Minor nit below. Happy for it to be pushed with that one change. Alan. > On 15 Jan 2020, at 11:51, Luis Machado wrote: >=20 > New in v3: >=20 > - Minor formatting and code cleanups. > - Added count check to validate number of brk SIGTRAP's. > - Moved count to SIGTRAP check conditional block. >=20 > This test exercises the previous patch's code and makes sure GDB can > properly get a SIGTRAP from various brk instruction patterns. >=20 > GDB needs to be able to see the program exiting normally. If GDB doesn't > support the additional brk instructions, we will see timeouts. >=20 > We bail out with the first timeout since we won't be able to step through > the program breakpoint anyway, so it is no use carrying on. >=20 > gdb/testsuite/ChangeLog: >=20 > 2020-01-15 Luis Machado >=20 > * gdb.arch/aarch64-brk-patterns.c: New source file. > * gdb.arch/aarch64-brk-patterns.exp: New test. > --- > gdb/testsuite/gdb.arch/aarch64-brk-patterns.c | 30 ++++++++ > .../gdb.arch/aarch64-brk-patterns.exp | 74 +++++++++++++++++++ > 2 files changed, 104 insertions(+) > create mode 100644 gdb/testsuite/gdb.arch/aarch64-brk-patterns.c > create mode 100644 gdb/testsuite/gdb.arch/aarch64-brk-patterns.exp >=20 > diff --git a/gdb/testsuite/gdb.arch/aarch64-brk-patterns.c b/gdb/testsuit= e/gdb.arch/aarch64-brk-patterns.c > new file mode 100644 > index 0000000000..ccf9a35a94 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/aarch64-brk-patterns.c > @@ -0,0 +1,30 @@ > +/* This file is part of GDB, the GNU debugger. > + > + Copyright 2020 Free Software Foundation, Inc. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see .= */ > + > +int main(void) New line between int and main. > +{ > + /* Dummy instruction just so GDB doesn't stop at the first breakpoint > + instruction. */ > + __asm __volatile ("nop\n\t"); > + > + /* Multiple BRK instruction patterns. */ > + __asm __volatile ("brk %0\n\t" ::"n"(0x0)); > + __asm __volatile ("brk %0\n\t" ::"n"(0x900 + 0xf)); > + __asm __volatile ("brk %0\n\t" ::"n"(0xf000)); > + > + return 0; > +} > diff --git a/gdb/testsuite/gdb.arch/aarch64-brk-patterns.exp b/gdb/testsu= ite/gdb.arch/aarch64-brk-patterns.exp > new file mode 100644 > index 0000000000..9a0ec81efa > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/aarch64-brk-patterns.exp > @@ -0,0 +1,74 @@ > +# Copyright 2020 Free Software Foundation, Inc. > +# > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > +# > +# This file is part of the gdb testsuite. > + > +# Test if GDB stops at various BRK instruction patterns inserted into > +# the code. > + > +if {![is_aarch64_target]} { > + verbose "Skipping ${gdb_test_file_name}." > + return > +} > + > +standard_testfile > +if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile}]} { > + return -1 > +} > + > +if {![runto_main]} { > + untested "could not run to main" > + return -1 > +} > + > +# Number of expected SIGTRAP's to get. This needs to be kept in sync > +# with the source file. > +set expected_traps 3 > +set keep_going 1 > +set count 0 > +set old_timeout $timeout > +set timeout 10 > + > +while {$keep_going} { > + > + set test "brk instruction $count causes SIGTRAP" > + > + # Continue to next program breakpoint instruction. > + gdb_test_multiple "continue" $test { > + -re "Program received signal SIGTRAP, Trace/breakpoint trap.*$gdb_= prompt $" { > + pass $test > + > + # Insert a breakpoint at the program breakpoint instruction so GDB > + # can step over it. > + gdb_test "break" \ > + "Breakpoint $decimal at $hex: file .*$srcfile, line $decimal.*" \ > + "insert breakpoint at brk instruction $count" > + incr count > + } > + -re "exited normally.*$gdb_prompt $" { > + set keep_going 0 > + } > + timeout { > + fail $test > + set keep_going 0 > + } > + } > +} > + > +set timeout $old_timeout > + > +if {$count < $expected_traps} { > + fail "all brk instructions triggered." > +} > --=20 > 2.17.1 >=20