From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2074.outbound.protection.outlook.com [40.107.104.74]) by sourceware.org (Postfix) with ESMTPS id EF3B63858294 for ; Fri, 5 Aug 2022 17:23:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EF3B63858294 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ImdBmLh/iSlheCW4604RRfgUl1KGG3Twc0BbebMp0WUSGVV32YVWZ3UVOeUlA5Kq1CEhqcleKPJaYsnj4IgbsBoYMaLoJ4Saoo/XymOE5iixAKQSY04DzjEwEI2hzUz9P4Q0svPRem4l6DAnhpow3ztNi6Py3i1FuRnDFmmYDWSe4pcSV8EUFTGlDxCilCjXVgVUO6ylq/JqPLvmebeD6Oy3Dp9ZI+ECRRZ1fnpVpOWl4KZKtgS+XdQntwoKRl/ca4ZhGlQMDNyYL37/YB5g23Z2E9Moa0hadRKdRF7pR2C6PqNdTaGt/ql4O+e8vcgaGCOKzJbbXPrOzMuelX9hFw== ARC-Message-Signature: i=2; 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=74dFqs95dOCN0AFfoQHkKYAnX59s0lNxHYmm3y9WkAs=; b=IBlGlFoZn/FJijWmdrJRe6ajDQm/o4CorJwXEybj4+6UrlCxk7iZtY7+tkkBautGGdzg+02eFBhEBdF9uZKjCFlH4XSolMSmAxj95WphUu+7tqBYX236LxZfBwwbhv82Xp/17648DNd2O6qW9jl9UqFb2hCd7L3ogF1c/krVgal41s951kM9UUhFNhbTDc+G+nNw/v2z7PPEsjmKSnZmKdwlwR1eAvHHTFRaIZQBKvZGOABHc5ILVZXc6lcvZ7KUyT9nTnQYG9yFUk+b5JiNmFSZ6KZmgdL5AZCu9BNejwUeL4xapesivzEsDRAkGrlbBKPvxkjcLBuigcxhFks1Ag== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) Received: from DB8PR03CA0012.eurprd03.prod.outlook.com (2603:10a6:10:be::25) by AM6PR08MB4771.eurprd08.prod.outlook.com (2603:10a6:20b:c8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Fri, 5 Aug 2022 17:23:36 +0000 Received: from DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:be:cafe::5) by DB8PR03CA0012.outlook.office365.com (2603:10a6:10:be::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16 via Frontend Transport; Fri, 5 Aug 2022 17:23:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass 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; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT013.mail.protection.outlook.com (100.127.142.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16 via Frontend Transport; Fri, 5 Aug 2022 17:23:36 +0000 Received: ("Tessian outbound 73dd6a25223d:v123"); Fri, 05 Aug 2022 17:23:36 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 179be773c0e87028 X-CR-MTA-TID: 64aa7808 Received: from cd35e3597b0b.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 3C7AD5FF-66E4-4B3B-91B6-91BE96ACA13D.1; Fri, 05 Aug 2022 17:23:30 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id cd35e3597b0b.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 05 Aug 2022 17:23:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V76fn5Vqpp7xXBRwvPRf3sdJmQLxaZyMswGxhFaa6lLE2yMK3K2BV2sVag4T9sMBK9nrWN9uejtGcvDnQsxllUxEWubIG5ZlBqaxbogw8+Zjhmkk6myF2sX8o8ygoi/VB+5It8PomAe12MvUYqjJxb7mILj5ovcBAZnJ+AT52+f4KqY9GpAiCBO8KFIAanQ8ygDiBpdGPv3vKJGzPGPHM6I1EbWvC7nlcLau3IlRwVJ1WoPLWMcobyRHuTojlgmuHSbGgHjd079R5D3C0SF883AMcAw6c+wV4vXkgMBuUIMwuN6a1w59ZS4/iE0S/urRLchaSopq6FHp+ZAfa0kIJg== 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=74dFqs95dOCN0AFfoQHkKYAnX59s0lNxHYmm3y9WkAs=; b=dVaEgVRM3R3H6JmAyj7h2npy7NeSael6YgyuXtPaAkp7MkH9ZGaXrFHzMNi/ksgpyZKXmSh5mky6248Vzw4JE4MRjXNvDfX7Apog4losMN6iu4mhttTR5dyohRY3sRJ41vLopiHz1UTPqNwvz53eVt+4SGIEgB7KCNspDg8mwg0XMqRg4fhH5Kjr4r0ff0F3jUv0nBVnbbIr5RTVynyeuSYQlKK8r1wXX5wWDcD15XdhEWII50xDlBhf0lbIrTQKBY17q6z/YYWyb+AWgKjrOdlm5vXRL883dOjetfk0IHTomH2PUWdfd3sxzLFrzYX+tuIHSeg9bsIPiUDYU4hpxw== 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 Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by AM6PR08MB5255.eurprd08.prod.outlook.com (2603:10a6:20b:ef::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.14; Fri, 5 Aug 2022 17:23:26 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::cc64:9170:b12d:de8]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::cc64:9170:b12d:de8%4]) with mapi id 15.20.5504.014; Fri, 5 Aug 2022 17:23:26 +0000 Message-ID: Date: Fri, 5 Aug 2022 18:23:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2 2/2] gdb/testsuite: Add test for AArch64 Scalable Vector Extension Content-Language: en-US To: Thiago Jung Bauermann , gdb-patches@sourceware.org References: <20220805004648.111358-1-thiago.bauermann@linaro.org> <20220805004648.111358-3-thiago.bauermann@linaro.org> From: Luis Machado In-Reply-To: <20220805004648.111358-3-thiago.bauermann@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0455.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1aa::10) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 703c69e0-613b-4cf2-8eba-08da77073b0d X-MS-TrafficTypeDiagnostic: AM6PR08MB5255:EE_|DBAEUR03FT013:EE_|AM6PR08MB4771:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: L8KSgclJue2zwxt2sQVdMPcYvege9MGnyq9u/oAkuPGL+JtP1w/SIVMtZq37stvY4Fa/GwrkAeQ1Z7gUDWvGAWZfn/lSfJo97N5AOgPOwDOwvCNeMrq8xlBOkh2fMmeshZ567Lyy3oWdt7hJ9/6T76qcybu01W8sFjkkBYR/AIOzrQcxkHdJMD2lGnAT5fZ592ux50DnIN2ryLSUredVJhN2IyBz+4frsrvpDK5HUSGz06v4sUE7TtdtemIKOGZUKPZHJ1V7y/eMpmlS+R2p7Drwnd02XbpB4oHq39JNtFWax2LkvNv5oOxwOs80aFQy9hJaMN3n9vyGgVHw3kd3FtDQzw5Q45SdTbyl1Bx30w8iGN7ZMeKm63KMuUc0eCfzPbFbLZY78w0LujKU3iGO2SVWRPd4tkQBOF2TfjfnYu1WZSVkmoJrFUd4FMldNNyvvKc3GOaellS/GS6utKjxC2mBk4U/oBwdxS2fZwIv75I3m2ik9bhbDVUDmXb1GA01kogae3fGpR7nLXdPRPZGliIsXsAV3ZihWcLXq9LNZw86spH7bJJxDbafxo/wJLwoHAGZQSyQsJdZbvaiRSzdocJ9ConJ4d/J19e76xqylMKgxF/aAgtRZkjqXqLNKqc/dGn7LzmdLNdhodWMesU/GrFaNM7NUY+YN1mwfjN01RljysTNdvFzcc/XEwiNvADtoZK6+R+iyC+zPxy0WSo8nrm6RyxjJBAtKtANSEiwdk+Qz/r2suivljN3My9Oc4bYb1zNTg7zQ+nURPztDfp5ptpjY03+d3cY3LF3Y3i0tgNWQ4jtAGXtX4KfA20Ay6iUiQxLdXHXzIluyOwPgIXHe/xU3ReAv7+KbPgsfjarw3asafzn/Wr0kynYQtYPncAe X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB3919.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230016)(4636009)(136003)(376002)(39860400002)(396003)(366004)(346002)(26005)(31696002)(6512007)(41300700001)(86362001)(6506007)(316002)(6486002)(53546011)(478600001)(38100700002)(186003)(2616005)(83380400001)(66556008)(2906002)(66946007)(66476007)(36756003)(8936002)(44832011)(8676002)(31686004)(5660300002)(2004002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB5255 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 0d888b5e-187d-4abd-5248-08da77073514 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pr6Km4c1DXHc+QqyuCN5Yp0rzwVWHagQWu5LLQzHJOKczh4ZSS5yiCZ9Z0w88HTP3h2dBU235homrlSD0jlAr18wqpcFrdh6ttfUtSM7thbnrlLQULlKDBLwamACFULFSklC+C+GcTRInlwjQemSyJqfibIlKsUHVBcpZebW72KDsJ7MGyVITwVYlKtWs2y7vX8zJ0ePsPmeHm7BBDqOxAPZexrTNWCgA9Axrb0rD+mrrAZseeGhqFTbLQ7wl8rZWuzzyzuB3aFsto26eQbtJUJFpopinvbQqMzDMb9hb9ClnT3c8CCh/xYRpwbKgrKoxVzDUJbQQ1Y85L+S8XH0rnIpGw1GWK9c6kNWcwBgh+3FoqFQ10m9HnofNev4K21qYT4u+hJ10FbeyvvMCgKEersBmYbNHW+a8AMgPIAl7Zd+NvcjSJ9e641yjYl3UWaPLDvLM7WqDIFBKfrJe47YuqN3gpXfn4m1O54Xxl6FjvSBmVEHTY+BNukP6Sb6IRkq2c3uh0oWJehs0ocuXfI1f1BSRGyqZaHPJFHMCBAhzTVtfLWey6RSSnPgbR5a43IcT0JEmOvsFgeEYBdmnWNwKFZb/jiaH5q0+P95ClC2UmQk6hedTSgrrl+GO19CTB8DhIR6cyA52ankGGyGQ7Ez+7FflGzNNqztCtF8skNG4sCy7dV/TUwnLwCaYlh/YAyCrw61j4EwbcGwJ/4kFOXrqpp/amGr7/MeO1y8lAykIUMufxxjd/dXbMJfRAs5ykgpngCRz2zvap7pjl88/6u9GQ22urY8/fVWgGJpHZxn935Bg5CJa52nYfDYDPJgky1BTqlIcVa53WV+I4Gop++LDnbgJZJc/N1v2SHA6X11zBHGaAOuO18iM623AsmWfzrt X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230016)(4636009)(396003)(39860400002)(346002)(376002)(136003)(40470700004)(36840700001)(46966006)(31696002)(86362001)(81166007)(40480700001)(31686004)(44832011)(82310400005)(70206006)(8676002)(70586007)(36860700001)(82740400003)(316002)(5660300002)(47076005)(26005)(2616005)(6506007)(186003)(336012)(36756003)(40460700003)(53546011)(356005)(83380400001)(2906002)(478600001)(6512007)(6486002)(8936002)(41300700001)(2004002)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2022 17:23:36.5410 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 703c69e0-613b-4cf2-8eba-08da77073b0d X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4771 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_DMARC_NONE, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-List-Received-Date: Fri, 05 Aug 2022 17:23:42 -0000 Hi, Sorry I didn't reply to the previous v1 discussion. See notes below. On 8/5/22 01:46, Thiago Jung Bauermann via Gdb-patches wrote: > It exercises a bug that GDB previously had where it would lose track of > some registers when the inferior changed its vector length. > > It also checks that the vg register and the size of the z0-z31 registers > correctly reflect the new vector length. > --- > gdb/testsuite/gdb.arch/aarch64-sve.c | 64 ++++++++++++++++ > gdb/testsuite/gdb.arch/aarch64-sve.exp | 101 +++++++++++++++++++++++++ > gdb/testsuite/lib/gdb.exp | 6 ++ > gdb/testsuite/lib/mi-support.exp | 4 - > 4 files changed, 171 insertions(+), 4 deletions(-) > create mode 100644 gdb/testsuite/gdb.arch/aarch64-sve.c > create mode 100644 gdb/testsuite/gdb.arch/aarch64-sve.exp > > diff --git a/gdb/testsuite/gdb.arch/aarch64-sve.c b/gdb/testsuite/gdb.arch/aarch64-sve.c > new file mode 100644 > index 000000000000..916b5cd82b38 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/aarch64-sve.c > @@ -0,0 +1,64 @@ > +/* This testcase is part of GDB, the GNU debugger. > + > + Copyright 2022 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 . */ > + > +/* Exercise AArch64's Scalable Vector Extension. > + > + This test was based on QEMU's sve-ioctls.c test file. */ > + > +#include > +#include > +#include > + > +static int > +do_sve_ioctl_test (void) > +{ > + int i, res, init_vl; > + > + res = prctl (PR_SVE_GET_VL, 0, 0, 0, 0); > + if (res < 0) > + { > + printf ("FAILED to PR_SVE_GET_VL (%d)", res); > + return -1; > + } > + init_vl = res & PR_SVE_VL_LEN_MASK; > + > + for (i = init_vl; i > 15; i /= 2) > + { > + printf ("Checking PR_SVE_SET_VL=%d\n", i); > + res = prctl (PR_SVE_SET_VL, i, 0, 0, 0, 0); /* break here */ > + if (res < 0) > + { > + printf ("FAILED to PR_SVE_SET_VL (%d)", res); > + return -1; > + } > + } > + return 0; > +} > + > +int > +main (int argc, char **argv) > +{ > + if (getauxval (AT_HWCAP) & HWCAP_SVE) > + { > + return do_sve_ioctl_test (); > + } > + else > + { > + printf ("SKIP: no HWCAP_SVE on this system\n"); > + return 1; > + } > +} > diff --git a/gdb/testsuite/gdb.arch/aarch64-sve.exp b/gdb/testsuite/gdb.arch/aarch64-sve.exp > new file mode 100644 > index 000000000000..803aae5fdfb2 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/aarch64-sve.exp > @@ -0,0 +1,101 @@ > +# Copyright 2022 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 . > + > +# Test a binary that uses SVE and exercise changing the SVE vector length. > + > +if {[skip_aarch64_sve_tests]} { > + verbose "Skipping ${gdb_test_file_name}." > + return > +} > + > +standard_testfile > +if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { > + return > +} > + > +set linespec ${srcfile}:[gdb_get_line_number "break here"] > + > +if ![runto ${linespec}] { > + return > +} > + > +# Count number of lines in "info registers" output. > +proc count_info_registers {} { > + global gdb_prompt > + set ret 0 > + > + gdb_test_multiple "info all-registers" "" { The use of "info all-registers" seems to introduce a lot of verbosity to the test and make it much slower (as you pointed out). Checking the code, it seems we always have either FPU or SVE. So at first glance it may not be worth it to list all of the possible fpu/vector registers here. With that said, there are upcoming features that may add registers to the vector group (SME), so might as well check all the registers. That's a very verbose way to say the above looks good. :-) > + -re ".*$gdb_prompt $" { > + set ret [count_newlines $expect_out(buffer)] > + } > + } > + > + return ${ret} > +} > + > +proc get_register_value {register} { > + global gdb_prompt > + set ret "" > + > + gdb_test_multiple "print \$${register}" "" { > + -re ". = \[0-9\]+\r\n$gdb_prompt $" { > + regexp {. = ([0-9]+)} $expect_out(buffer) matched ret > + } > + -re ".*$gdb_prompt $" { > + } > + } > + > + return ${ret} > +} > + > +# The test executable halves the vector length in a loop, so loop along > +# to check it. > +for {set i [get_register_value "vg"]} {$i > 1} {set i [expr $i / 2]} { > + set lines_before [count_info_registers] > + > + gdb_test "next" ".*if .res < 0." "step over prctl vg = ${i}" > + > + set lines_after [count_info_registers] > + > + # There was a bug where GDB would lose track of some registers when the > + # vector length changed. Make sure they're still all there. > + if {${lines_before} == ${lines_after}} { > + pass "same number of registers vg = ${i}" > + } else { > + fail "same number of registers vg = ${i}" > + } > + > + gdb_test "print \$vg" ". = ${i}" "vg was changed to ${i}" > + > + set size_after [expr {$i * 8}] > + > + for {set j 0} {$j < 32} {set j [incr j]} { > + gdb_test "print sizeof(\$z$j)" ". = ${size_after}" "z$j has ${size_after} bytes" > + } > + > + gdb_test_multiple "continue" "" { > + -re ".*Breakpoint $decimal, do_sve_ioctl_test .*$gdb_prompt $" { > + # Next iteration. > + } > + -re "Inferior 1 .* exited normally.*$gdb_prompt $" { > + # We're done. > + break > + } > + -re "$gdb_prompt $" { > + fail "unexpected output" > + break; > + } > + } > +} > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index a8f25b5f0dd5..b6bfa8eaafa5 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -7885,6 +7885,12 @@ proc multi_line_input { args } { > return [join $args "\n"] > } > > +# Return how many newlines there are in the given string. > + > +proc count_newlines { string } { > + return [regexp -all "\n" $string] > +} > + > # Return the version of the DejaGnu framework. > # > # The return value is a list containing the major, minor and patch version > diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp > index ca56e12b06bf..e821c0f6914f 100644 > --- a/gdb/testsuite/lib/mi-support.exp > +++ b/gdb/testsuite/lib/mi-support.exp > @@ -1728,10 +1728,6 @@ set mi_autotest_data "" > # The name of the source file for autotesting. > set mi_autotest_source "" > > -proc count_newlines { string } { > - return [regexp -all "\n" $string] > -} > - > # Prepares for running inline tests in FILENAME. > # See comments for mi_run_inline_test for detailed > # explanation of the idea and syntax. This looks good to me overall. I'd be more comfortable with someone else approving the generic bits (though they look quite obvious to me). Again, thanks for the patch.