From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id yJT5NV232WdKHxQAWB0awg (envelope-from ) for ; Tue, 18 Mar 2025 14:11:41 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=JFXpug7f; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D79371E100; Tue, 18 Mar 2025 14:11:41 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=unavailable autolearn_force=no version=4.0.1 Received: from server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id ECE0E1E0C0 for ; Tue, 18 Mar 2025 14:11:38 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF49C3858405 for ; Tue, 18 Mar 2025 18:11:38 +0000 (GMT) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by sourceware.org (Postfix) with ESMTPS id 338CE3858417 for ; Tue, 18 Mar 2025 18:11:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 338CE3858417 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 338CE3858417 Authentication-Results: server2.sourceware.org; arc=fail smtp.remote-ip=198.175.65.19 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1742321473; cv=fail; b=RnhW4H3BB+yzSnCKZ4dr/fjqT2agd1VN/0TIhVuQtyWhg92pKDvUeY62nFy1roHThqtSidi7GEBoirb/MbFeSPXiLM0YgjqVKUAIl/iMIN0aynEv4nGKBw4NiczH8orgQBdakyK5nsdPvbRiwNvy72P7n7bU9FIEcSBeUqxoBtY= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1742321473; c=relaxed/simple; bh=iluyqj6YBO88MApPr5QnruLncvOG9MfA38HndipthXg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=O4hF4TPdVUb4ctNwhch1xSeTx3DKa5PTx0fvslS79a+VP6AUoAt9wfeToXZNP1bl6gxnsOJTt0w52U2iflU7PizN1K0RXD3borSVnz7lMpsdNj4tWAyEaq7q+eO+SOBBqc0T0nSugTQGXy3BlhToeaHOEquoLj5WeTrHMJhEEfk= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1742321473; x=1773857473; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version:content-transfer-encoding; bh=iluyqj6YBO88MApPr5QnruLncvOG9MfA38HndipthXg=; b=JFXpug7fmdRMziNUVpu7bpQ695PbuVMuqL7Db9j5y9Af0DeIbVAk/qOl vbx4v4X6SvMo3wY1RzEP20H8b63B4axC322H+q1WndW9Lg2ACiWx7BiUU V9x/E9ZUHGO03tsY0t+WMrQU+vB1++Gvsv87FhlN/5PFbKou+CXV/pPJe fXuitIvWGPL5ynMNXnidwIytB143G1c2RE3fi4MVYkSH6iCqDNklPzrls EWOC1G0AnysFx6GQ4732jBkTo+pyMcp51RK4GjxYPSSc9wwqAsAdMy7jx 3DV3pQ3QWZGg40kGlU2Ckl05sDy2OKjsY0h9SutfHzHSwDNbN4g0vH4RU A==; X-CSE-ConnectionGUID: qbJ0/+qITUmd2BUQ2zA2Vw== X-CSE-MsgGUID: WMGTxgiNQCygY8H96tlwIw== X-IronPort-AV: E=McAfee;i="6700,10204,11377"; a="43347881" X-IronPort-AV: E=Sophos;i="6.14,257,1736841600"; d="scan'208";a="43347881" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2025 11:11:13 -0700 X-CSE-ConnectionGUID: pqXXSMcEQrK5RgObitVlhQ== X-CSE-MsgGUID: AY7Bl9tbQUyxs0y6+9Y32g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.14,257,1736841600"; d="scan'208";a="122266486" Received: from orsmsx902.amr.corp.intel.com ([10.22.229.24]) by orviesa010.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2025 11:11:13 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX902.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.2.1544.14; Tue, 18 Mar 2025 11:11:12 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44 via Frontend Transport; Tue, 18 Mar 2025 11:11:12 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.49) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Tue, 18 Mar 2025 11:11:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=eK7JFB/Vx6YuyV7KsEentXEb9tmO00D4WyWYQadkCZNrMlwBxzxO6Nql5Tb9bmsvOGkAIPJ2wkQ5VxT8fwX50uxwFkYpP7E/Mslb89s0g2tgevAI0n+JhbeFodhYcUxYrmKG9tiAGaSR1tAFk1qIP7m820ziAGWu3tllHIeFSdUDtK+cB6mochWUqUibJO2AyLNFMLNB1+ePNVzAH3G0NLZjnTDxzDNh2pdVfmMyOsFXPaW9GRBb9IA+259FTesbzqn4VUzCIl//0be6MOqG5mjndQ0GPzZDKyUP9Aq1YcBEO3Ew9fAWTcpLj64JtvoRiqBC4jvgZLh9Bl70VGSxww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=Uru17wJsR1nN2HGZiFBxKKo8UBwxmvRVXY7Vu9wICN0=; b=J5wK/2NVv1ZP4PeMx71lynw1E+n+i2rH+FgW0zWS+JtnTahPgLHCJkrh/nJ8x/rjOg+rmesU1DaH4GLkiF1w7J5N8aMnEuyHVt/ElJbYIxKFQyRBpX+kytyPzP27saGY666sVmw5bpfniy/CdhLK67bt5koaylYeWI5lM1j55JnQIAxa7sLgJuwEJr7p2lSA6VBAPPle7XxmqqxLilP51HuHMrV4CmTccjT3yvFexIPNSHYJi+hjhzkjy8uvTpjf9n2M1o5b3AA1XsFAgVfP/ykBoAoS5/yECrFND4yYjJL82x90p8P9jXbnK2GJa2qyt1zUTZPV4sYpoh1jcDzG9A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM4PR11MB7303.namprd11.prod.outlook.com (2603:10b6:8:108::21) by LV2PR11MB6072.namprd11.prod.outlook.com (2603:10b6:408:176::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.33; Tue, 18 Mar 2025 18:11:09 +0000 Received: from DM4PR11MB7303.namprd11.prod.outlook.com ([fe80::3935:4973:1b78:da44]) by DM4PR11MB7303.namprd11.prod.outlook.com ([fe80::3935:4973:1b78:da44%4]) with mapi id 15.20.8534.031; Tue, 18 Mar 2025 18:11:09 +0000 From: "Aktemur, Tankut Baris" To: "gdb-patches@sourceware.org" CC: "simark@simark.ca" Subject: RE: [PATCH v2] gdb/infrun: do not restart a stepped thread if not running (was: gdb/infrun: reset thread control's step info in end_stepping_range) Thread-Topic: [PATCH v2] gdb/infrun: do not restart a stepped thread if not running (was: gdb/infrun: reset thread control's step info in end_stepping_range) Thread-Index: AQHZo4tqkRa9cB7xykSW426EN3rHNLCGIsKwgswv8iCAKsg3AA== Date: Tue, 18 Mar 2025 18:11:08 +0000 Message-ID: References: <20230620152455.471716-1-tankut.baris.aktemur@intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM4PR11MB7303:EE_|LV2PR11MB6072:EE_ x-ms-office365-filtering-correlation-id: 4312a6d1-c409-48b2-f6f6-08dd66484221 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|10070799003|376014|1800799024|38070700018|13003099007; x-microsoft-antispam-message-info: =?us-ascii?Q?pmTazHQbynxVHUoia6qgP5LMZrYx4nrZGhh4Bwna/ne9wDrUQBFBVAsW+r+s?= =?us-ascii?Q?bPJLw76YNVli3paLdLGj+FuzBOKM5R5CdgRmHl9PFuLUK6IonBja5M3P2CmD?= =?us-ascii?Q?dx2xzDPST5drg019yURrnKGSMvoNM7c9PUongjxTyH8/2orQh6wb2JHHSYJO?= =?us-ascii?Q?vKLXmt4SbfKGpB5zDRo+8VzzcnZw2EvUVa+mJtrCxI9XQaU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7v0qMlQq/fp0BcJCJ/AMZwCfMfjLqp8tXDbyQUPwFs?= =?us-ascii?Q?mlBYldVB7qxRLvCurqSjdEGXtnRM+HL5gBDBGqSJil6E4t86SIuNQ7jbEaSQ?= =?us-ascii?Q?OFrPaQ1Kh6u3SNFTxlCjALQ5znvcN96+KrWrfW8N5swDTIFbC0vBmYW9BcwR?= =?us-ascii?Q?R0+rmmSNA027NLHy9fgVznZc290d8ZN9auL7IuHL/i7zdAU67dfp+PDV3RMl?= =?us-ascii?Q?LXtdXiwmGzxuSo3KgmDoUjeTW8oIkvaVv7P8aAQCtpSffVlGGox3MHqRROFA?= =?us-ascii?Q?YBOF9248pesoCpQRARfMG1ITKp0mN2c+J/LWRCHYWUi7B0laQw=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB7303.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(10070799003)(376014)(1800799024)(38070700018)(13003099007); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?teM2GXlenlRWDHOzt2G5GiHdzl7abFZHAuJazmStJjmAvsK9kaJCVluBRPe2?= =?us-ascii?Q?9EYMHf+d9wdoApwFPMeBWjlArOcn+bVLjhrJoT89aWU8y5WrU3gPQzlOC7GS?= =?us-ascii?Q?c5af7EfSFZdrMs8eh4qg6oUy+xxAtbumBTir5PU8uxP9HWilNz7/QXbhoQts?= =?us-ascii?Q?g4CQITra1JOJ0c7xnU95T8JBvvXfPd7UvoPzHnD0OCmRtnX9YoNj2GGCuMj7?= =?us-ascii?Q?yySD+AlSj8tN5VOwjtlxXIUzInki0ENXhdGuDsftyQrl4AYZUkjoXtDbTYdC?= =?us-ascii?Q?GpOGHSRvYGBf65mCfMEhYnlmLweu/cCFKMHLfdyJoSyXJLiAzoanzKsxSxHe?= =?us-ascii?Q?1l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5OLmgFGgWvgWGI?= =?us-ascii?Q?w18trP1zm+5q3C8y6a6y4z7+YPyypRjqiNNXItknGEqA+M2lp91v4xnI6Fej?= =?us-ascii?Q?gg9Z2GlNGX9j0JUcu0OBVtCEPl9W6QUTT0z8gjl91tdjcnwLxJ0kRXPDqCc6?= =?us-ascii?Q?hOZzIIBBS2IeXwK+sivS+by+X2LnNT4ElN32fOGZQlMFZBjIm7uCHjNW7OT3?= =?us-ascii?Q?VaDpfy35ur+4fL7G+qzarDKWLQBfnBb4JQCZ1owsYWnvb2t8r7Urrn15tKm+?= =?us-ascii?Q?YNohOYeGvmScVoufr3biFK5AIIkOC2CxSVmyoyS4Kjzh2iXHU0yesVLjWqEk?= =?us-ascii?Q?AhbI6BJJhSPnNdNQwqC3IdWkaF7p4XP8zDa+TST31/iBYyjQQcRQDaoZX6yf?= =?us-ascii?Q?emfO94o8LO5dxvqFLfG+mlRPWhek3AqtXYJDiteMsniiAeHUuTC9Gj0+oVX0?= =?us-ascii?Q?QA4Xrw=3D=3D?= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM4PR11MB7303.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4312a6d1-c409-48b2-f6f6-08dd66484221 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Mar 2025 18:11:08.9217 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: pfmrm+OBim8718rZ7N30LDoY3UCXUyk/P0OKUgR8NBXqYbqOPWbw4UnyrAjsA9L5JIxOhvKfIE6sSLlgtYEc5S1ce4e20Zx8raz60fukOtc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR11MB6072 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Kindly pinging. Thanks, -Baris On Tuesday, November 21, 2023 9:01 PM, Aktemur, Tankut Baris wrote: > Kindly pinging. > = > (The patch was Tested-By: Guinevere Larsen ) > = > Regards > -Baris > = > On Tuesday, June 20, 2023 5:25 PM, Aktemur, Tankut Baris wrote: > > =3D=3D=3D=3D=3D=3D > > Changes in V2: > > > > * Changed the thread state check to `(tp->state !=3D THREAD_RUNNING)`. > > * Rebased on the current master. > > > > The latest discussion was > > https://sourceware.org/pipermail/gdb-patches/2023-May/199613.html > > > > =3D=3D=3D=3D=3D=3D > > > > Suppose we have two inferiors on an all-stop target with schedule-multi > > set on: > > > > $ gdb -q > > (gdb) target extended-remote | gdbserver --multi - > > Remote debugging using | gdbserver --multi - > > Remote debugging using stdio > > (gdb) file /temp/test > > Reading symbols from /temp/test... > > (gdb) set remote exec-file /temp/test > > (gdb) start > > Temporary breakpoint 1 at 0x115c: file test.c, line 8. > > Starting program: /temp/test > > stdin/stdout redirected > > Process /temp/test created; pid =3D 864027 > > ... > > > > Temporary breakpoint 1, main (argc=3D1, argv=3D0x7fffffffd218) at tes= t.c:8 > > 8 foo(); > > (gdb) add-inferior > > [New inferior 2] > > Added inferior 2 on connection 1 (extended-remote | gdbserver --multi= -) > > (gdb) inferior 2 > > [Switching to inferior 2 [] ()] > > (gdb) file /temp/test > > Reading symbols from /temp/test... > > (gdb) set remote exec-file /temp/test > > (gdb) tbreak 2 > > Temporary breakpoint 2 at 0x555555555131: /temp/test.c:2. (2 location= s) > > (gdb) run > > Starting program: /temp/test > > stdin/stdout redirected > > Process /temp/test created; pid =3D 864430 > > ... > > > > Thread 2.1 "test" hit Temporary breakpoint 2, foo () at test.c:2 > > 2 int a =3D 42; > > (gdb) set schedule-multi on > > (gdb) > > > > At this point, detaching the first inferior works fine: > > > > (gdb) detach inferiors 1 > > Detaching from program: /temp/test, process 858904 > > Detaching from process 858904 > > [Inferior 1 (process 858904) detached] > > (gdb) info inferiors > > Num Description Connection Ex= ecutable > > 1 1 (extended-remote | gdbserver --multi -) /t= emp/test > > * 2 process 858925 1 (extended-remote | gdbserver --multi -) /t= emp/test > > (gdb) > > > > Let us now repeat exactly the same scenario, but before detaching, we > > make the current thread single-step an instruction: > > > > ... > > Thread 2.1 "test" hit Temporary breakpoint 2, foo () at test.c:2 > > 2 int a =3D 42; > > (gdb) stepi > > 3 int b =3D 43; > > (gdb) detach inferiors 1 > > Detaching from program: /temp/test, process 876580 > > Detaching from process 876580 > > gdbserver: Couldn't reap LWP 876580 while detaching: No child process= es > > [Inferior 1 (process 876580) detached] > > (gdb) 3 int b =3D 43; > > > > There is a mysterious line info output. Running the scenario with > > infrun debug logs reveals more information. > > > > ... > > Thread 2.1 "test" hit Temporary breakpoint 2, foo () at test.c:2 > > 2 int a =3D 42; > > (gdb) stepi > > 3 int b =3D 43; > > (gdb) set debug infrun on > > (gdb) detach inferiors 1 > > [infrun] scoped_disable_commit_resumed: reason=3Ddetaching > > Detaching from program: /temp/test, process 872445 > > Detaching from process 872445 > > gdbserver: Couldn't reap LWP 872445 while detaching: No child process= es > > [Inferior 1 (process 872445) detached] > > [infrun] start_step_over: enter > > [infrun] start_step_over: stealing global queue of threads to step,= length =3D 0 > > [infrun] operator(): step-over queue now empty > > [infrun] start_step_over: exit > > [infrun] restart_stepped_thread: switching back to stepped thread (st= epping) > > [infrun] keep_going_stepped_thread: resuming previously stepped thread > > [infrun] keep_going_stepped_thread: expected thread advanced also (0x= 555555555131 - > > > 0x555555555138) > > [infrun] clear_step_over_info: clearing step over info > > [infrun] do_target_resume: resume_ptid=3D-1.0.0, step=3D0, sig=3DGDB_= SIGNAL_0 > > [infrun] infrun_async: enable=3D1 > > [infrun] reset: reason=3Ddetaching > > [infrun] maybe_set_commit_resumed_all_targets: enabling commit-resume= d for target > > extended-remote > > [infrun] maybe_call_commit_resumed_all_targets: calling commit_resume= d for target > > extended-remote > > (gdb) [infrun] fetch_inferior_event: enter > > [infrun] scoped_disable_commit_resumed: reason=3Dhandling event > > [infrun] do_target_wait: Found 2 inferiors, starting at #0 > > [infrun] random_pending_event_thread: None found. > > [infrun] print_target_wait_results: target_wait (-1.0.0 [process -1= ], status) =3D > > [infrun] print_target_wait_results: 872464.872464.0 [Thread 87246= 4.872464], > > [infrun] print_target_wait_results: status->kind =3D STOPPED, sig= =3D > > GDB_SIGNAL_TRAP > > [infrun] handle_inferior_event: status->kind =3D STOPPED, sig =3D G= DB_SIGNAL_TRAP > > [infrun] context_switch: Switching context from 0.0.0 to 872464.872= 464.0 > > [infrun] handle_signal_stop: stop_pc=3D0x555555555138 > > [infrun] handle_signal_stop: [872464.872464.0] hit its single-step = breakpoint > > [infrun] handle_signal_stop: delayed software breakpoint trap, igno= ring > > [infrun] process_event_stop_test: stepi/nexti > > [infrun] stop_waiting: stop_waiting > > 3 int b =3D 43; > > [infrun] infrun_async: enable=3D0 > > [infrun] reset: reason=3Dhandling event > > [infrun] maybe_set_commit_resumed_all_targets: not requesting commi= t-resumed for > > target extended-remote, no resumed threads > > [infrun] fetch_inferior_event: exit > > > > GDB attempted to do a step-over for the current thread. This takes us > > to the commit that introduced restarting step-overs: > > > > commit 408f66864a1a823591b26420410c982174c239a2 > > Author: Pedro Alves > > Date: Mon Jan 11 20:01:58 2021 +0000 > > > > detach in all-stop with threads running > > > > A following patch will add a testcase that has a number of threads > > constantly stepping over a breakpoint, and then has GDB detach the > > process, while threads are running. If we have more than one infer= ior > > running, and we detach from just one of the inferiors, we expect th= at > > the remaining inferior continues running. However, in all-stop, if > > GDB needs to pause the target for the detach, nothing is re-resuming > > the other inferiors after the detach. "info threads" shows the > > threads as running, but they really aren't. This fixes it. > > > > However, the thread that was resumed for step-over in our scenario did > > not have an interrupted step-over; it had completed its stepi already. > > More debugging reveals that the thread is resumed because of the > > following two conditions in `restart_stepped_thread`: > > > > if (tp->control.trap_expected) > > { > > infrun_debug_printf ("switching back to stepped thread (step-= over)"); > > > > if (keep_going_stepped_thread (tp)) > > return true; > > } > > > > and > > > > if (tp->control.step_range_end) > > { > > infrun_debug_printf ("switching back to stepped thread (stepp= ing)"); > > > > if (keep_going_stepped_thread (tp)) > > return true; > > } > > > > The root cause of the problem is, `restart_stepped_thread` checks for > > the thread state as > > > > if (tp->state =3D=3D THREAD_EXITED) > > continue; > > > > but the thread's state is THREAD_STOPPED. To fix, we change the state > > check to > > > > if (tp->state !=3D THREAD_RUNNING) > > > > Additionally, the 'trap_expected' and the 'step_range_end' fields of > > the thread's control remain set even after the "stepi" command > > completes, creating a half-baked internal state that can be misleading > > when debugging. We address this problem by clearing the control > > fields when stepping completes. We also add a regression test. > > > > Regression-tested on X86_64 Linux using the default, native-gdbserver, > > and native-extended-gdbserver board files. > > --- > > gdb/infrun.c | 7 ++- > > gdb/testsuite/gdb.multi/detach-stepi.c | 30 +++++++++++ > > gdb/testsuite/gdb.multi/detach-stepi.exp | 66 ++++++++++++++++++++++++ > > 3 files changed, 101 insertions(+), 2 deletions(-) > > create mode 100644 gdb/testsuite/gdb.multi/detach-stepi.c > > create mode 100644 gdb/testsuite/gdb.multi/detach-stepi.exp > > > > diff --git a/gdb/infrun.c b/gdb/infrun.c > > index 58da1cef29e..f40d924dc7a 100644 > > --- a/gdb/infrun.c > > +++ b/gdb/infrun.c > > @@ -7776,7 +7776,7 @@ restart_stepped_thread (process_stratum_target *r= esume_target, > > > > for (thread_info *tp : all_threads_safe ()) > > { > > - if (tp->state =3D=3D THREAD_EXITED) > > + if (tp->state !=3D THREAD_RUNNING) > > continue; > > > > if (tp->has_pending_waitstatus ()) > > @@ -7800,7 +7800,7 @@ restart_stepped_thread (process_stratum_target *r= esume_target, > > > > for (thread_info *tp : all_threads_safe ()) > > { > > - if (tp->state =3D=3D THREAD_EXITED) > > + if (tp->state !=3D THREAD_RUNNING) > > continue; > > > > if (tp->has_pending_waitstatus ()) > > @@ -8523,6 +8523,9 @@ static void > > end_stepping_range (struct execution_control_state *ecs) > > { > > ecs->event_thread->control.stop_step =3D 1; > > + ecs->event_thread->control.trap_expected =3D 0; > > + ecs->event_thread->control.step_range_start =3D 0; > > + ecs->event_thread->control.step_range_end =3D 0; > > stop_waiting (ecs); > > } > > > > diff --git a/gdb/testsuite/gdb.multi/detach-stepi.c b/gdb/testsuite/gdb= .multi/detach- > > stepi.c > > new file mode 100644 > > index 00000000000..d365645fb3f > > --- /dev/null > > +++ b/gdb/testsuite/gdb.multi/detach-stepi.c > > @@ -0,0 +1,30 @@ > > +/* 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 . */ > > + > > +void > > +a_function () > > +{ > > + int a =3D 42; > > +} > > + > > +int > > +main () > > +{ > > + int b =3D 43; > > + a_function (); > > + return 0; > > +} > > diff --git a/gdb/testsuite/gdb.multi/detach-stepi.exp > > b/gdb/testsuite/gdb.multi/detach-stepi.exp > > new file mode 100644 > > index 00000000000..28ef8c4f9f7 > > --- /dev/null > > +++ b/gdb/testsuite/gdb.multi/detach-stepi.exp > > @@ -0,0 +1,66 @@ > > +# 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 . > > + > > +# Test detaching from an inferior after a thread in another inferior > > +# completes a stepi. This is a regression test for a bug that was > > +# causing an inadvertent resume of the just-stepped thread. > > + > > +standard_testfile > > + > > +if {[use_gdb_stub]} { > > + untested "using gdb stub" > > + return 0 > > +} > > + > > +if {[prepare_for_testing "failed to prepare" $testfile $srcfile]} { > > + return -1 > > +} > > + > > +if {![runto_main]} { > > + return -1 > > +} > > + > > +delete_breakpoints > > + > > +# Setup inferior 2. > > +gdb_test "add-inferior" "Added inferior .*" \ > > + "add empty inferior" > > +gdb_test "inferior 2" "Switching to inferior .*" \ > > + "switch to inferior" > > + > > +gdb_load $binfile > > +runto "a_function" > > +gdb_test "info inferiors" > > + > > +# The bug for which this regression test is written appears in > > +# schedule-multi mode. > > +gdb_test_no_output "set schedule-multiple on" > > + > > +# Single-step the thread in Inferior 2, then detach Inferior 1. > > +gdb_test "info threads" ".*" "threads before stepi" > > +gdb_test "stepi" > > +gdb_test "info threads" ".*" "threads after stepi" > > + > > +gdb_test "set debug infrun on" > > +gdb_test_multiple "detach inferior 1" "" { > > + -re "resuming previously stepped thread.*$gdb_prompt" { > > + fail $gdb_test_name > > + } > > + -re "$gdb_prompt $" { > > + pass $gdb_test_name > > + } > > +} > > -- > > 2.25.1 Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928