From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2051.outbound.protection.outlook.com [40.107.20.51]) by sourceware.org (Postfix) with ESMTPS id BDE293858D3C for ; Fri, 18 Mar 2022 17:28:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BDE293858D3C Received: from AM3PR07CA0133.eurprd07.prod.outlook.com (2603:10a6:207:8::19) by DBBPR08MB4347.eurprd08.prod.outlook.com (2603:10a6:10:c8::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5061.22; Fri, 18 Mar 2022 17:28:16 +0000 Received: from AM5EUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:207:8:cafe::49) by AM3PR07CA0133.outlook.office365.com (2603:10a6:207:8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.8 via Frontend Transport; Fri, 18 Mar 2022 17:28:16 +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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT044.mail.protection.outlook.com (10.152.17.56) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.14 via Frontend Transport; Fri, 18 Mar 2022 17:28:15 +0000 Received: ("Tessian outbound 826a6d8e58c3:v113"); Fri, 18 Mar 2022 17:28:15 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 35bc83fcf80813d3 X-CR-MTA-TID: 64aa7808 Received: from 1f4238daa76a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6F5702B4-D964-4518-85AE-997BD3DACCE7.1; Fri, 18 Mar 2022 17:28:09 +0000 Received: from EUR02-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1f4238daa76a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 18 Mar 2022 17:28:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CLfrswllLsWUhOLoGUAfVl+8zrTfADBwWBIwTNXk/vS3hxBgEN1vUjjAnINIvD16P3lP12Jh0Xi2T/6gVqianxRHXk1h5T2xs4Lmka/ke+8ZETKxcI8y9XIx9aqAYsdT9sVw3k4pOGbGMETdEC9GW0Q7NNnREnUqnVKFT447hjosApPPpPt+CB+TZqZz/9cxHaWkAfgULFu6KSdduEooHvTLL2ckAZQTy/F/wEHQO01X+zX3ar/KAdVAaKQP1YXrxu+toeCBwdZCgvg37I4CtXQlkPDiYR9Wx0QDCKqmZjWvu/5gx7p/Vvit3m9dh0GZUxgWeeDrK+LtmXiZfYOm2Q== 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=7bcZYtzWSwEsUzUOtOxAD1mzNZl0gBNdjrjSbE/qNr8=; b=i1ywSskATaCdO50gPwjpwCZh/PbUNLRbBIJ/PDCLAQHILun9UqbEPVcNYzeIMG+R93Mmz4RTc5jqgoC3m+y+Ny29nwmmqx1/0u7SyAiyIBFgZ1PPGWQTK72BCn82kPw5Njg8tmP1IiXflNSAL3ZrXiDF/alUE/X84N+fJEnjIyhlHlcjoQBPMCPCG0zeW7utdfBYFOkkTM0G5q1ahLSlWBHKJU3a2Yh0WMe2/7+ilNSYRXZTJ+ZjQlbSr61Ae2kl+n8unniOtMWE3QgYtdyouZbdi+fXR95o9C0dYi3z22KmpY1ZXZCUmDaU1OS9rmLE+Q9CjTnpU0AN6uWQ7egEFw== 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 DB9PR08MB6937.eurprd08.prod.outlook.com (2603:10a6:10:26e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.15; Fri, 18 Mar 2022 17:28:06 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::4d3d:c632:297e:1dcc]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::4d3d:c632:297e:1dcc%5]) with mapi id 15.20.5081.017; Fri, 18 Mar 2022 17:28:06 +0000 Message-ID: <0b5fba12-dbde-827a-fd0b-2a439e6309fd@arm.com> Date: Fri, 18 Mar 2022 17:28:03 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: Step causes GDB to spin in infinite loop when PC doesn't change Content-Language: en-US To: "Denio, Mike" , "gdb@sourceware.org" References: <96dc6d3f7ab542368f7ac43abefadf4b@ti.com> From: Luis Machado In-Reply-To: <96dc6d3f7ab542368f7ac43abefadf4b@ti.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0327.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18c::8) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: aee438a3-09a1-47ad-007c-08da0904afce X-MS-TrafficTypeDiagnostic: DB9PR08MB6937:EE_|AM5EUR03FT044:EE_|DBBPR08MB4347:EE_ X-Microsoft-Antispam-PRVS: 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: 7VUg2bFYuAcQON0UXIEZ7BD/Xoz5DzAD7Qlvol6gyZlVpNWjYo6fmNgNBT+yp3d386Fld0k7+RjeVkRMQO9dvhBVb6Y+a5nsqmDDSfR4itaJKIfxvOwLFW8MAfSr9NAECy37+471sgy/LukB07+KMdYYy13p3WS386IxofZxX7Ib0wxbh5zmUDZMXPwNHzYmQoGXYFMsDgxtGQ3gmbz38WBiBwdynyZcgJ8eCpLlHhr1yXe1DJfv4KxYJ5BNddSwcbswLffhyFQvOWkFNhiuSY49DmbI2529Kk/jsf9UoHNFqxESOUuB+3dbLXu95SWRWq+JZXUEs5YcSxD6niqzRssPX9FCJgpBTEBmsapUyN1pT3Q4h+gxJTlgcVtfX8r+g7S3bN2WgNDq94aKPxlsnhhFldUXZiw5+4CYQ7XORTU05p4gx3IzrVzQn3CQMizTB+fy32bXSGTGj5wkYdkI65iVnzyLFo3aaRz4UEPUbE2CPQHPh2i6PBe1cqHsHET8cfVixwtT4ZMPrV0aFn0GLlGlu1Oe1DszYVE0vrvgYPvGwtwLt7LNjLTuK/SMz/Q9PhuiJkdH3vVCUri2dLejPWNboFwijsfLCQaUbZlKM75z0JDVvfv/U41qxkk7MSn/yPiV7Pw7Qo0OJ/H6OIx0Jy0k2n9mAFH+bO+r4jQglp1FKa6HZAZLCZzsZ9dYnyDNfSJXUgTFv0JZzg/EE2GjLYOJNoPYqFa85hOdUeARdII= 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:(13230001)(4636009)(366004)(53546011)(6666004)(110136005)(6512007)(6506007)(316002)(8936002)(31696002)(44832011)(31686004)(86362001)(5660300002)(36756003)(508600001)(2906002)(8676002)(186003)(26005)(66556008)(66476007)(2616005)(6486002)(38100700002)(66946007)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB6937 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: AM5EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f98319a0-e700-457a-f213-08da0904aa1d X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: gJmFZGQ1voX11RIF6uuYlNt43nfDEvzqZEDy6WuIzKiFM96eOVBN4XmIoorS6EcjFs4YZcUCXFrvZWQQ53ebhHO4G1yyhdoAOJ1FQIJ6PpVHESiQ7LC0gxy6J4JM2fbr7CHR2LDh2JjSN8pGYR1vMhYAP+rf3F/J2M28cWiyJTEavBVlQifcfc5bsF28/+VFjyPm2JB4uoH+4tTiJItcnfaL2jrfI7AF8W+xblu1pEvOXV3nqVzL9eHwMv7Yp15p9cRR8czzDjQWo5IaHeIg5YBrWQV2qL+7Y38o04TKPrDv0jN9VK4TAoi4tazynDEcYmDt4eMXzOZsJlD6uRakvOmnC0D/4/ebDa8UigV21Nqz+1slnakwwMlkHrnGRHNw7ouUMcefUcMGR4ZZBZXMl9K57b2Fe+ScOofmW1nIEmptSliR2lsi0rt2dNouayxcnErF/ApYAPkP1f0vkQlxCTrBzX0CEjXdEYMHOkPQ2nlNj4xI1E/sWKODs9NXe61JiRHKMq/an8zaHDqtTdC0Erq8dmYKwLdGruofyb/gUFmF7Inm9c3DHJZO+WRWj1nprTaW+M6MGN2Thk5w1nrKk+CbwZ1uHbVvfnKY9/+sJhGrqBsq2bH0B98TyNe2EgOM69TEXUR+bfEdTAM28moxXoTVsZJDnhlV9MELFqy5Mj2A9Tfays9HfgPmYVxMLJg3UYOgm2fRHPz8D5uYpv8MNA== 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:(13230001)(4636009)(36840700001)(46966006)(40470700004)(8936002)(2616005)(6512007)(44832011)(26005)(53546011)(6666004)(6506007)(31686004)(5660300002)(36756003)(508600001)(336012)(186003)(36860700001)(47076005)(6486002)(82310400004)(70586007)(356005)(31696002)(70206006)(110136005)(316002)(2906002)(40460700003)(81166007)(8676002)(86362001)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2022 17:28:15.9754 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aee438a3-09a1-47ad-007c-08da0904afce 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: AM5EUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR08MB4347 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2022 17:28:20 -0000 Hi, On 3/18/22 16:33, Denio, Mike via Gdb wrote: > I am seeing an issue with the remote protocol on GDB with multiple threads on a riscv32 using the step command. Not sure if it's a bug or just me, but it seems like a legitimate bug. > > I am using a custom server. The behavior is the same on both GDB 11.1 and 11.2. > > This GDB was configured as follows: > configure --host=x86_64-pc-linux-gnu --target=riscv32-unknown-elf > --with-auto-load-dir=$debugdir:$datadir/auto-load > --with-auto-load-safe-path=$debugdir:$datadir/auto-load > --with-expat > --with-gdb-datadir=/usr/local/share/gdb (relocatable) > --with-jit-reader-dir=/usr/local/lib/gdb (relocatable) > --without-libunwind-ia64 > --with-lzma > --without-babeltrace > --without-intel-pt > --with-mpfr > --without-xxhash > --with-python=/usr > --with-python-libdir=/usr/lib > --without-debuginfod > --without-guile > --disable-source-highlight > --with-separate-debug-dir=/usr/local/lib/debug (relocatable) > > I am running in non-stop mode. A full log of the test is at the end of the email. The GDB commands I execute after connecting are: > (gdb) interrupt -a > (gdb) s > > The problem is that my code starts off in an infinite loop (endz: jal x0,endz), with the cores basically waiting for an interrupt. If I execute a 'step' command, GDB will basically keep sending "vCont;s:2" in an infinite loop, until the PC addr of thread 2 changes. It also occurs if I fall into an infinite loop while stepping. It doesn't need to be the first instruction. That's what the step/next commands are designed to do. GDB will keep stepping until it sees a line change. I suppose a "continue" command here would be more appropriate, as GDB will send it once and keep waiting for the outcome. stepi/nexti would be undesirable given they will stop after a single instruction.