From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6PvPI5ni72ccmSYAWB0awg (envelope-from ) for ; Fri, 04 Apr 2025 09:46:01 -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=bJwCvPIx; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8DB841E0C3; Fri, 4 Apr 2025 09:46:01 -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 5D4831E05C for ; Fri, 4 Apr 2025 09:46:00 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 11EF1383982B for ; Fri, 4 Apr 2025 13:46:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 11EF1383982B 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=bJwCvPIx Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) by sourceware.org (Postfix) with ESMTPS id 490D4384978D for ; Fri, 4 Apr 2025 13:45:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 490D4384978D 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 490D4384978D Authentication-Results: server2.sourceware.org; arc=fail smtp.remote-ip=198.175.65.17 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1743774323; cv=fail; b=JOzAt9ot825x8203I0RrFR2WISY333nq0H56zNAObewuUtP21CICKGtjqtgwV+3fCqyic8wfTDtk7cwFlVBOjnqQeFbmjcNecbFlvERqC2cW6OPqtQacnmjuiCoFw+lQ1Bwt80QVs2O/xVd8y8J7Kn2Dmpm/RmN2I3VihczkDaA= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1743774323; c=relaxed/simple; bh=iluyqj6YBO88MApPr5QnruLncvOG9MfA38HndipthXg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=UdxD2NRWMmHqjP94LxmM5lK8jPMdPwQwljuuxUOuiTFZw+EQkPTI+YYimAUEDpS0x7f/lQOfDhOzDwDFDiB5i9VMZCKgNVIeRnCyiS3bURk3bhKC2hqh4CAMK46CB5pLj8eg5i/brTdd9bK05Rl8EnSKRfwspP4DSOv9FADkuho= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 490D4384978D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1743774324; x=1775310324; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version:content-transfer-encoding; bh=iluyqj6YBO88MApPr5QnruLncvOG9MfA38HndipthXg=; b=bJwCvPIxRiD/j4h4OIOsFJuFKjYiTbMzOMBsgmRN9o51DyTZDBr+jFkQ iTdgbMelLwheW6T8vqW/QRW3WzcDdnDDJmYSeqWXgYMbMSvGoyUN0outR 1xS1EKOHjkXZR6fTTjbeAp6NmKOYQ+Sm/+TtH/kZVMhW/5K2s1RWZqbHr E599J9gSoL5ftgSr+aLlhpDNKvi+Bp1ByIB+AdRZezSNyXfVdf/8VQgOp DSJDADMm/jduClMO2xx2HjBH80M8spU+Syb06y3XmKPe69DX+M7zgplu+ BFClzVN/0TYD9Q8aIZ6f8vdng9NDmYY7bbfq3UXaVIq6CvaLoRQE8Mrti Q==; X-CSE-ConnectionGUID: BUAk0GRaTjypV3hnkS4w+A== X-CSE-MsgGUID: C4qvi6goSnaLJlGX6UxACw== X-IronPort-AV: E=McAfee;i="6700,10204,11394"; a="45230908" X-IronPort-AV: E=Sophos;i="6.15,188,1739865600"; d="scan'208";a="45230908" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Apr 2025 06:45:23 -0700 X-CSE-ConnectionGUID: 8h30G+zsTJ+kR5UlbzxSmw== X-CSE-MsgGUID: U3uengFyQtG6Af1bD6iOLQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.15,188,1739865600"; d="scan'208";a="158300769" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa001.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 04 Apr 2025 06:45:22 -0700 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) 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; Fri, 4 Apr 2025 06:45:21 -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; Fri, 4 Apr 2025 06:45:21 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.168) 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; Fri, 4 Apr 2025 06:45:21 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WtADLDiba5vz01l+DG3ON4xvkFyLoIMZDlA4QmAx9L3sgP8ZeRvQBi6A7/umggrl6hp0F3JcsYayA2HRHs50mESpL1eECdjJdAxZSSDLMwipToER+fNe96L3C+p5Uzp60SToS9rl3nebV5bAyh4EqlBjnzTzSVaKcaIvmvqXoApofKIOmAoSc4vnwce2FHXJu17p1QqqfJZ9cQIxkoRDfl0aAYvjcwaui/YZOOnrFdzj+rx271ifl98jYG15fLNZetOxfiKUfy+hQ0IC0d3DYLbro0lWZe9sQGjp/PMzRebRDunMoTVMOcxmOW74Si68WbpRsFDzKiLWoSQHe1IVzA== 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=XAs8eS/lxDxhAvoMKcjz7JV+RbHdJ9WQBhju5eQ8gMsBKtfaYRZzEo33XrerXQoRs0mu0wKgplwhTvPrOxeYmx6a2uw0zCZnWzBDZU8xvPfyFAkekHV3iXm+F8buQV3cPSl2ZoIMI5lkHlw4IEKgzA7vJmbH1353irKIN6k2gZE0wDZ9xdNFGv1wFlWErgzDwWiF33PwRLlHakeHQ9Zw1SkvZj1XQIlSg7SGeAUVOBtTpLrg/lgfDNCFQc8g1625GRO8u5R9vtaXu9xyryTFoKmrpfqVOO27a4LZK+vYiVcVj+YjFJDBMmhCxp4lQkoxkz9paTVoTr9le5HZdDBcTg== 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 IA1PR11MB7320.namprd11.prod.outlook.com (2603:10b6:208:424::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8534.54; Fri, 4 Apr 2025 13:44:30 +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.043; Fri, 4 Apr 2025 13:44:30 +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: AQHZo4tqkRa9cB7xykSW426EN3rHNLCGIsKwgswv8iCAKsg3AIAabTVA Date: Fri, 4 Apr 2025 13:44:30 +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_|IA1PR11MB7320:EE_ x-ms-office365-filtering-correlation-id: f24f6552-1b7b-467a-f88f-08dd737ed389 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|376014|366016|13003099007|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?JjI41W3IGS4km1LTYH1AQyBCbVjcLGvku18gn2SZXQ3XQKbS6mvg398F0jHV?= =?us-ascii?Q?ubrl+1eAPj+Zma4KgTsw+2Wq/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Zi8gRzjhRFS3yRcVK0VBoWLpFUzWYdEylDX+8PuIqHyYrfWvdhbY0q+MC?= =?us-ascii?Q?LqvJ8ijRRrjdlT4Myeqb1o48lO2NE6P2yLhi7G1MISZRTADtb/KzaqvS74b0?= =?us-ascii?Q?PJENNXllUjM/hE+PqYFImwOr12Yy26NjxV8y60mqttcwwwuFuUX7VgeptK2q?= =?us-ascii?Q?camDmtjc1v7D+e9R2JhKG73Q2rE6R6EY6pXn6DaO/hgWunLAY2zP8QxXEDen?= =?us-ascii?Q?0/4UBLait4BsL7Yh6AdL6mPkkdFb3HNmY6J/kNll3C6TnilnuRctjBRZWXG2?= =?us-ascii?Q?m5pwgOvPO4omGq2P0DTTAs/7mE2bKynB/W8xrKRvSj0EExxfj/5vkGhYLFlp?= =?us-ascii?Q?Ec+qXRjOGo5RATU4TbfChgLeSzFMKGmeHqRNAM7yDZdMJEOgivuB9YT6MMJs?= =?us-ascii?Q?78KJU2ZSfywAI7l4ORCQQiQrGjYuacLJwZmuT84Ey8QiHAmzHw=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)(1800799024)(376014)(366016)(13003099007)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?u2qJdNrb/lgcuXkrkEnsd+vVyvuWGUPJSOl7j1C6oplfvaQ8HAF4r4n13YoN?= =?us-ascii?Q?rCoo6tS5nSq2A6mUTd1cdxNRODBIhSOlBc088V9p8Wp1rev5KlvIWxV++UaG?= =?us-ascii?Q?meZHQw7/XksufhljgbyTtPsatzhhT1Q5MRJPIrGrMf0EGHWCJmtezpNOnvKX?= =?us-ascii?Q?13ygUeDOxDOOzPanbj60ekZR5BMD9ryuMQR4pgvKuJlNo9YJzgxZSIv0v7dq?= =?us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Hu3IIyVIWGqMdtU7o49?= =?us-ascii?Q?eAgLUxxtSLL0pl4SKLRV/Y7HH99fRxc8YuPMIrjSbYmnHSHc0oCkm1HVTS2R?= =?us-ascii?Q?MeuHc/RXvJgzkfodeD5USMQcDBbBd1wLg1zhUzJhPSSgk6Ohr0GLfoHPJTqW?= =?us-ascii?Q?FodOO7lahE6OIlIpbwnU5m1iZ7i8sfxVzHlEQR6VWG8X0PRxeAb0Dp9lU8xA?= =?us-ascii?Q?q2MOQgx8S9sMhPnFtIm9roLz+6UTPd8+JfV+VCvKqd2nRV0OY+U+ORBR9Gt4?= =?us-ascii?Q?eOwMsIHb2CeCpN1nvLKv/vyktUy4+B9TemuzRNAr8XKTK6dCZC+Z4zzo8SES?= =?us-ascii?Q?9fXvJsIyePMv1Mvv/lHP0+Up44ipd82SEUAu/zhkXZA9hZm3aWg+lR2uXiDw?= =?us-ascii?Q?eFIfOUKWv+9pEIxjgS3k569tMFEK2UMRafx6tg2PuXfSIVbTeOUUgjHwIOPU?= =?us-ascii?Q?Ks6e829n8e8wKtzeH4Bfy5CVB1/ahCUWR0qHdSEE92jJm1TcXxwxv/sPDKo6?= =?us-ascii?Q?Iw=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: f24f6552-1b7b-467a-f88f-08dd737ed389 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2025 13:44:30.8096 (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: aNn7CaR5GkE3oi74bIbW5bKTDRVy+Z34A+WAUW8BDju/SfQTkYD5RmK2M2q/QdmjHspeRsuAhiTPp99D0OdmpVaP0PQOaYqsTCcvB6RA7Ts= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB7320 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