From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id /Bs0HDmeCGijFwEAWB0awg (envelope-from ) for ; Wed, 23 Apr 2025 04:00:57 -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=IDbF7ix+; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 397811E0C3; Wed, 23 Apr 2025 04:00:57 -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 873E91E0C0 for ; Wed, 23 Apr 2025 04:00:54 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 355B0385781B for ; Wed, 23 Apr 2025 08:00:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 355B0385781B Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=IDbF7ix+ Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by sourceware.org (Postfix) with ESMTPS id 2860E3857C7B for ; Wed, 23 Apr 2025 07:59:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2860E3857C7B 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 2860E3857C7B Authentication-Results: server2.sourceware.org; arc=fail smtp.remote-ip=192.198.163.14 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1745395171; cv=fail; b=YqAN4wuficS9VpnDzNirhW5KXN8U9r868OjdIAB1CKZlaxXkJt7f0Fhnu1IiIaokAghFBJZFifyQo6w54vLDa3y1/o/+ioOCE7Rk2lLwbtOQIxMEvRujuV68vvASvrFpC4tCjHsGkPFgtu+8rtQa0WXkbLcJ4uxqaPsiNL6FAV4= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1745395171; c=relaxed/simple; bh=iluyqj6YBO88MApPr5QnruLncvOG9MfA38HndipthXg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=A13zEgAVfNmtH8VbryRv7ekcXuN/jo0Mq8kLEENUmY3JhU4FGhVWuE/FxohBIK2shdLYLVHGcD2QD+uQFzzE0DQOsIie8vC7E5051YYLcUG8WYFwyYhr8DvJ1psDUHlNg5+0LcnbOaKkTD+cSu+Fyt+szwHXUbEU3pK1J0Gb7+o= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2860E3857C7B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1745395171; x=1776931171; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version:content-transfer-encoding; bh=iluyqj6YBO88MApPr5QnruLncvOG9MfA38HndipthXg=; b=IDbF7ix+fK0/gyrqbuTA/rOprgritS9GmD7yn8XD7bi2M47djZ6GBCYt FI8sn8u1Hxq5nmDaG2YA1WXS8svIrHJrFw47wPoxVAAMfivC0nTG9LYgG 7XDgV9LQdQukMBWr247+/zbWAtumvwjPaQSEvl2Ii1YhODPGScXMPcvu4 UD5/CSo5oCGx7HaRRxcFpVzBv3MYZ0gg3gF/oj4RdKvPDKyH1soJ2EK+M bvNRylgIL3PCGRuLKsKtjDVz+vZy1/mj2xpiPWO95wQ8icW83GJs9woSD RBl83Q5l4CwuDotylNlMCAIEThlxwC9ho/b6Lc2SpXFuJbFzANkvfhqUM A==; X-CSE-ConnectionGUID: coXjqrnVRLqdYQ8OO4X+Xw== X-CSE-MsgGUID: k/aoP0/NQZeOpEh2AZGAqQ== X-IronPort-AV: E=McAfee;i="6700,10204,11411"; a="47156863" X-IronPort-AV: E=Sophos;i="6.15,233,1739865600"; d="scan'208";a="47156863" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2025 00:59:30 -0700 X-CSE-ConnectionGUID: hncK3j4nTsa9wTOSDHwWnQ== X-CSE-MsgGUID: CNMOmg4KSAWWWbFCvfp1AA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,233,1739865600"; d="scan'208";a="132554412" Received: from orsmsx902.amr.corp.intel.com ([10.22.229.24]) by fmviesa008.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2025 00:59:29 -0700 Received: from ORSMSX901.amr.corp.intel.com (10.22.229.23) by ORSMSX902.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14; Wed, 23 Apr 2025 00:59:29 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by ORSMSX901.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.14 via Frontend Transport; Wed, 23 Apr 2025 00:59:29 -0700 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.44) 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; Wed, 23 Apr 2025 00:59:26 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=n8wetrTASy6DOe8xOmsDokMEjrht3qNK5X6QK9JUtgjaxNLQnRUNYjmSn9eAJAlRuAQqVKK1faNIbovUgqxIauhVH7OHG9L0tthmURmDro8SrmtcWArgvwU2P2IpRs2jTI+7OmiH93Ef5VeqqUJLSZff2jX6HxrCP+OM9t6N/JeaA+pi3KUBa2BvTSEVWjtQLn1Pwd71ylzApD8uAJGJVfYpWKl8CRJ1xhSnyqxSWOZX/aSL/8iH+WYICrwSuzPBXAbuR6gBpQkJqOSjAo/KSNl1M9mIE9vfKLfvRtYhxOPoNmEeM5TKlNQ39Z/ySYzpyLCErXjaj+e5b7cfSjG3fQ== 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=PkNaE/udw7KPZ99p28/eBAwIVvLXkGnBjPjLWNWXQTlnd5BfGrlORpiJpwWpSOcZEiSU+kjZPKFCBx1S2N0W77ryg5/BFOfn8NA6mla/FhGdGSkvmUeBzyuiQ/AlLms3zzSMXo6AmKofAW0ioey6YCg5j9/JEoksU5ZoFF85XiORZHlDMwvqbfuiwyxtLcfsRdVaIdAAPQ/nvEa6GQNf4D8T2n2eAIXceBgqo7BpKYA6v2D9HxHvStvtl/vL02IPF6ay1D1TekvMcdr08G1WTnOW9p1qIaGXvxHjjES2uggixFOPMA8VFrYlg7Ip1aXTC74gNrxm+qqUwU+mRmYkaA== 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 IA1PR11MB6371.namprd11.prod.outlook.com (2603:10b6:208:3ad::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8678.23; Wed, 23 Apr 2025 07:59:11 +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.8678.021; Wed, 23 Apr 2025 07:59:11 +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: AQHZo4tqkRa9cB7xykSW426EN3rHNLCGIsKwgswv8iCAKsg3AIAabTVAgB171nA= Date: Wed, 23 Apr 2025 07:59:11 +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_|IA1PR11MB6371:EE_ x-ms-office365-filtering-correlation-id: afd2f460-4898-4234-2606-08dd823cbbbc x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|13003099007|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?KA/prEJLCLcWy5lhVJgVWIRJwMYdpR1w3U5Di6VI/+8DNtE3TGW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HFxv/yzcOXiTgl3XRhWCZwKkOvit?= =?us-ascii?Q?3XbzV3s5xbMMqmCnT5ZXsRxBy1dGoer8R1/g69s25Htt2tIWtLiYOjNm7l2b?= =?us-ascii?Q?Q4gP3VESMnxV8zo0VKAzCXpDW6r5Qz0A0hjfLJksHS8Gtw/Hmts53xDn+bF7?= =?us-ascii?Q?w7h67U++Tv46N5kTAJ4iahl5saWLJ8kq2NhyTPxTIar2SFS2VThQxUY8Iet9?= =?us-ascii?Q?BSuQ739etr1UDP4vKZ7lYBjPrC3EGlT5JuVeWENFpKOZLQqz++T6IC3N2YG1?= =?us-ascii?Q?EdkdMu16uGznQVHr7sqMQoHTWGN1CJO9eOqmp1vuS+sAlUDLCsjJmEIVMaBE?= =?us-ascii?Q?malvJS+1sc6U+0JBkMaB4z7pzziqJPlAckXWHMttofwfrZwjd99RPg7y5zWW?= =?us-ascii?Q?TN/nSIsMToqPsGwtv6wPlUu71eYG3hq3AtlX182Coy80+cAnwPqKHNPg7vsw?= =?us-ascii?Q?/mmTKOyoT2X9enFsYQoftR/5AGSPkVPINA+Fm+37K6BpQf102a/lL6WR78K2?= =?us-ascii?Q?9NoLWz/s9+8=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)(376014)(1800799024)(13003099007)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?7WupQPZNbVKzYNFBy5BmEAUMjBqTy+OfFONuxOh5padz60VT7VT4a9nZ/nIT?= =?us-ascii?Q?DNVoIYuSTZHfJTLl+LiLQzoDxOIShmjkxYvVea7hsrSVF5p+98KKKu38hu2y?= =?us-ascii?Q?DIy6gT9e/yMpijX96/WHy0jsYf2cHUpKMtoP6AS1t9y4HwYaz6D2vTLECW3s?= =?us-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cAl05z7htyjILDbWqy6dl3v+eD?= =?us-ascii?Q?3i2l2YhLmm1Rszi9vZp+COSwH8LfaI1YMk8zaV173jirbOzjSltrnP9YqU5t?= =?us-ascii?Q?UfwXeMq2KeWXze1LkosKCA9MvX3lmr3qoW5rgMtKKs61e86sg6Zuwwh4Ao//?= =?us-ascii?Q?nPWBi6KDKMXsiSIOGlRdRIujD7nxwXuVOl8nlyfDEgH5MgB4zNkHcJ+sMwzm?= =?us-ascii?Q?6tDWaoaAwlFn8QMAjNFgA3KrBgF21q14oynmYZVcDdYZsSBqf4yAyG/dgrAW?= =?us-ascii?Q?n/3wtPLvZL6tS9oyfau79z0NgRQOUWARDYhbdtnaWv3Y6+f0XYoYVgv1zNUJ?= =?us-ascii?Q?822ag7DlZGUwktLhfGq+T3J4aTQ9gj+krnRs/mef+BVT2tB3tlMsM4hrfXw2?= =?us-ascii?Q?SAqBJMtwDdyCytMmL6xZooZLiSdZqh0qbpdXbk1Ve3A656IdT0dYQDR9DvDX?= =?us-ascii?Q?hLXIbuq+IaM6ilagUGCtw3doQR/k14EN6olnIK6+ccFgtbZDtLIfmtVHdbGF?= =?us-ascii?Q?4TZrGEq7j/6/oEgZ2kUNmi9dHEci94Ks+ivoe9+gqyclP3wz/3+XF69hXUby?= =?us-ascii?Q?Ag=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: afd2f460-4898-4234-2606-08dd823cbbbc X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Apr 2025 07:59:11.5390 (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: GZQqHn66llwlikHdSDyKJHNLaZ3T+Of1SfhaSOvOJXH4D+qwOAXjlkMXJgzxr/MNWfN8QXzREtKT17AU7nJKD9KxaClr4tFKFDOnjy+CP+8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB6371 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