From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 94wNHxPmrGqUMBoAWB0awg (envelope-from ) for ; Fri, 18 Sep 2026 03:19:47 -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=c4VuxwHN; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 705B71E06A; Fri, 18 Sep 2026 03:19:47 -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=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (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 984FC1E051 for ; Fri, 18 Sep 2026 03:19:45 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A588A4B99F66 for ; Fri, 18 Sep 2026 07:19:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A588A4B99F66 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=c4VuxwHN Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) by sourceware.org (Postfix) with ESMTPS id 7EAB84BA79B6 for ; Fri, 18 Sep 2026 07:19:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7EAB84BA79B6 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 7EAB84BA79B6 Authentication-Results: sourceware.org; arc=fail smtp.remote-ip=192.198.163.18 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1789715954; cv=fail; b=MYfPsqpuuyOFPROoaj3el8BLnLRYYQPL1Tdw0dPRMfRZfyeRt4avRFz21y4IY8J85l88MFnMuO04eoNW4BPBuztqrrqPeD/Nz9haU55ypidaoKqaluy+So7FtGcNcGbEKQWei1aS5giMCnOfOmBI2e2zRWZ31B1iCFGP2VT/Fbk= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1789715954; c=relaxed/simple; bh=v7cN/9aBBYqYKiT5EhIXX4WBuvb62l7hk+8Lz80Mbb0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dToL99A9MeX/n3vJvHbfLKgr3Hh25j9j5PmbMzrdLnQ7mht6CwH46wGX0bq5kv/LWzZ+JxrrlzHxkOa/AGK+Pd5k7Z02xGUTIuFDrn76rYp7zbG2jbjWtZOR+Z/pF4YWzICwTuqFqr+KR+50KMMtOeFZzbdcer6wdNnXUWLKu5s= ARC-Authentication-Results: i=2; 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=c4VuxwHN DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7EAB84BA79B6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1789715955; x=1821251955; h=from:to:subject:date:message-id:references:in-reply-to: mime-version:content-transfer-encoding; bh=v7cN/9aBBYqYKiT5EhIXX4WBuvb62l7hk+8Lz80Mbb0=; b=c4VuxwHNtLUwIccMYgPLwo4tEvjz2Xt+sBjNYX2Zm5qoPGsPgrVmk8u8 cbHdarSMiqGMOTMc4MGQOj1ShPJ1sXQH52XPSyTUV3SOfyRALQLS9W2in oawV3AaqRSOn+SV+wmdQwlXUt4BprhGFE26eIpvJ3bANz7ePYRBkoZv71 /qVqtCBHW9109odFSWvJe6H5T2CHMJZMIjnADHEM7MqTGAP+7Rp6DZ08C GX6asH2Awsyxx5SPM78HL7Uk1+c0kOlstJvgx5yAabKCQq+NyjKRnoCXh UOmlhkykSZauFV8Jz9YUwyPKbXhjqKb+dq4Rs1R53Yk75pcAlmQZfH+bs A==; X-CSE-ConnectionGUID: 0DB2WePaTAmTO4DBtTb+kw== X-CSE-MsgGUID: dL4YKFe3SyWWA4THKMGjRg== X-IronPort-AV: E=McAfee;i="6800,10657,11905"; a="89338079" X-IronPort-AV: E=Sophos;i="6.27,103,1787036400"; d="scan'208";a="89338079" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2026 00:19:12 -0700 X-CSE-ConnectionGUID: kC0WA1i0RT+G2jFyfs6CqQ== X-CSE-MsgGUID: V33GrcA0QK+MTE/xm0f3wg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.27,103,1787036400"; d="scan'208";a="276224545" Received: from orsmsx902.amr.corp.intel.com ([10.22.229.24]) by fmviesa004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2026 00:19:12 -0700 Received: from ORSMSX903.amr.corp.intel.com (10.22.229.25) 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.2562.46; Fri, 18 Sep 2026 00:19:12 -0700 Received: from ORSEDG901.ED.cps.intel.com (10.7.248.11) by ORSMSX903.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.46 via Frontend Transport; Fri, 18 Sep 2026 00:19:12 -0700 Received: from DM5PR21CU001.outbound.protection.outlook.com (52.101.62.50) by edgegateway.intel.com (134.134.137.111) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.46; Fri, 18 Sep 2026 00:19:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i0IZo8zK8uueMrkpzQD7liFMAXoXwSrstdHeiNJVHhwtxwfti3qSdtr2XCA69Yx/QgC2qmKXXPeQQ/Q1d5FF+VK8RGZOHa1lQarP76RW3vgsSUBCezL/YW92qjuPPtxhjdEQEPEwRxeMi6ecK0QGWv6A+15JOZ5rcdq5l0cejAJl2UwDoU0JRPiegdySTkP3ukQgNx802mTE1vCnEUwey4blvFWpVSY8vLC4OBC2I3u3zv3BLzYxtSp9BBio/JHiYg+8zJuHhV9xi9Jh1bYBBUFIITMDyzXKIit1faR5Zc1yfIlu+vJuq8PJJmFKimyhyblLQ7l1xYySoIRTDxKruw== 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=AXVosetF6xQVrrMKl+OPzeNqRIw8Hw3kAf7UmfeaLm0=; b=Tp9WBQVvEaXyo6CE9tYcQxJE7O2eoO0sbShh6uVbwWaQLYkN1N6HObVnaJ+5PBHbX2owET2l/nd/yrhmRcrr939vdoTCO/Hv5kLiVkh3nkubNjwVWohd4Twr7oU4whgbEhaSHv7qWCkaD65/P6YbAtGu0K2OxqSCiPubNAo4sy/IebHJK7gVCV+cwJm/dqXQGRhg3+UrhIOGr83PW3nXTFg4T6rF+L1ywH8GDDai25bdjmFcSntt0ILqhdQ9+EKFHbOY9WRKlzHv5HkLlbAzeVNHPAYP2LutFWzVsBND/umn3wBikBQpWRDScWK1u1ky9tZrdYzCCLgAJrE6bFgusA== 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 DM8PR11MB5749.namprd11.prod.outlook.com (2603:10b6:8:10::15) by DM6PR11MB4722.namprd11.prod.outlook.com (2603:10b6:5:2a7::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.406.12; Fri, 18 Sep 2026 07:19:02 +0000 Received: from DM8PR11MB5749.namprd11.prod.outlook.com ([fe80::3085:48ed:687d:e6b6]) by DM8PR11MB5749.namprd11.prod.outlook.com ([fe80::3085:48ed:687d:e6b6%6]) with mapi id 15.21.0428.011; Fri, 18 Sep 2026 07:19:02 +0000 From: "Metzger, Markus T" To: "gdb-patches@sourceware.org" Subject: RE: [PATCH] gdb, infrun: do not discard a step-completed pending waitstatus Thread-Topic: [PATCH] gdb, infrun: do not discard a step-completed pending waitstatus Thread-Index: AQHdRRyccBJe6dETGkiXZkrbT3n847bT8WOA Date: Fri, 18 Sep 2026 07:19:02 +0000 Message-ID: References: <20260915141441.2274270-1-markus.t.metzger@intel.com> In-Reply-To: <20260915141441.2274270-1-markus.t.metzger@intel.com> 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: DM8PR11MB5749:EE_|DM6PR11MB4722:EE_ x-ms-office365-filtering-correlation-id: d75d2f99-07bf-4e32-9e6c-08df15551dab x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|376014|1800799024|23010399003|13003099007|38070700021|3023799007|11063799006|10067099003|56012099006|5023799004|18002099003|22082099003; x-microsoft-antispam-message-info: n3tnKcHd0L9fnrYwWt9fZ2/r8GswhgU5qbkB4JNGY1FLNMAfkbXhG03QtauHRE5IdS4Q3A3kwJe9V6rAiMynB+oo9svvOCLg8flfhqrKybRYXQAsFdruXtQjXXOccezINZ5heWs3jWHhTL1ob9XDEbbMivi5Npc7TfzWwZ8YK3UI6iSz1zrYVWeiht2wf7+08gyarAc1xVkycUnTn1MBYwCd8QjfvGHT0JxQYdJccO6+2gFgy2ClPWQXs8EdkA+M3G52E1QmMRlyE8ZiHieB7H8FkPJcpMkvCLkFhtS+4Snj3ehcbNvIaakfRrPncAqXIqCKGiSnHDtMSm0qqamlNZkNfaF3E5i8eRc5aAz8cim68tF5OebmZzovXcI8GtYw7IpdPMj5OhZ6Y0wL6Y6B/+KMto8nSZUxRQZVfLd9AEej8r0lmxkfJfQgaedJibQLOfF+Lpz3QMXb3JDJjNaxcDMk4VayZ/oMaBB3xf5dAMpTJVKGkOJyJ15ECiHg3Li6HQ7jEWzQdIixYF5ic4Y+IyhZAAIlI2y/+RtW5cWgp/wrbVYoLqDvM4lFmnLL2H2UOCXtNdxTV5XBnzReTkyFeczfM9eFOc9mLhVvImhj/YTRBpI//DnUcYGmtzqrF7QPVcPrqxGs/Gv+zrkLLSrBlZmtz+NJ7xs/IczbR++r0AQrLqBZM/Ofg0gJPBrz74qELRDmb8LD9eybSJyPo83gtAeRDaE++VVuYO/+71Vdjes= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM8PR11MB5749.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(23010399003)(13003099007)(38070700021)(3023799007)(11063799006)(10067099003)(56012099006)(5023799004)(18002099003)(22082099003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?V5zn0swC/UM+0tzI9xdfmYvOC7G1p3YCYpX7Q4suwYw6Ic1YnKwr2lGrBhJ0?= =?us-ascii?Q?qnFneaoRIdGd8tj0QvkddOlQdqgI1xdAXibYiYIouOIf4gXPZFrauLIYc74A?= =?us-ascii?Q?QPdo32OZGDNczBUqBlHmidzjxuNajN4yQRaQLc0lBKi1u5rwlPtsIUteC5pY?= =?us-ascii?Q?H3I9vp+m27pNdX6LpzjegojvzolopdHmYgHDQVB53AdBmcddQ9O5P4vSX56E?= =?us-ascii?Q?5+o6mDlDENqmSV6v0x/qW3VeYs3L35yqKtaUNEvWKSPwfgqUDoBbt/+EXo2K?= =?us-ascii?Q?pP1Xr8gbfe8G+olwZ8vTjdMq7NtuJkv7CNIclQHSR8iLKA//e2UO7QjubYtl?= =?us-ascii?Q?ZLXvDSmnQ4nP7nJbbiUJAWaKIe0o2YQlM5K7gaplp6n3l/WgFiJLqTKu/GBY?= =?us-ascii?Q?9If3uK01us9qsR6UwloCQMqGNcPpKKAJ/kFkZIMTcGQT5LN1tMWF/qyp/bdU?= =?us-ascii?Q?SN2KKN1ihgPyqevX0+92nDGpiS0XnSGpMSTbHlNagdxWGnd0showk72gMtAb?= =?us-ascii?Q?TwlB5cAuaVx2Z3JcF6Ad6XG2wlbWfly99TgxmmDaIGRqBOMS4goe8UcOnboQ?= =?us-ascii?Q?IJ3A8E9FqpEogrh65o0oU5lIMH9jWEMBzzxpN4tWNopduRwglKRdpAYrsHiB?= =?us-ascii?Q?FWai9nphy2zm6mJiqzaiks3g9QOAW4pjg7sQEUT/uCW0YVkuFZHXpymUI6fT?= =?us-ascii?Q?gGcKZK+qpfwHMSDTaRj7+Nq93gEHrSJ1ct5yEOsiuy7slpjxC/GhAi20ZFhn?= =?us-ascii?Q?PTgN1MFO52Mkbdfc4O9oi0J4GHGYMWVngeDm+22kqVFrDEdw0nMOp59wQFry?= =?us-ascii?Q?PcTF9nJquFGbA4muZ4Mwpdmnisrg065oflx8cZT4RyHd6Pv11N4AeQpVvKHJ?= =?us-ascii?Q?SiiM3rxiDsGEaEITgishH8xZLHVe1KFzBkuzM2TlYca8bufigytspv4TGMoL?= =?us-ascii?Q?1zG7B0PY5mhsSNjXKZc9zPRTzMNpueacWH3Hz3Ky0ggbfa2oNmhKZwSjAxEA?= =?us-ascii?Q?VUuOxdDfH0zQAMccAhNEXCLSQI6YiKQSAns2TxBAIhB8dLQm8pbXUltGLnG1?= =?us-ascii?Q?074gVE/Rw2IzcicBkvGEKBB0EUGBGR0RO9S6YCTD4VwEV7quIlnPyHHxOEcg?= =?us-ascii?Q?0npc7JkNrFBw6i7htAM7506QY89RdFQYHIMZhJNU3QhyWsM8/ls/bNcOZ24u?= =?us-ascii?Q?y6fFpjFP5agXvXLLCLd9PfmcawWkXRUsG9H2nJzEcA89OmuVJe9O7B+WdYfo?= =?us-ascii?Q?OFvku0w7fG+cIsC3o8a+wPlNq0SEj3Rn9hBOLMnjWRXrWEGUhipfd/06RK+Y?= =?us-ascii?Q?QVBzEJtnSoIyQ7O3ZMOnyju5DbbDC1MT6QPqLExBgLmGB8ZT53/gES155E3q?= =?us-ascii?Q?nbpQCyGcmrtbkJH0b63jefODFD/tBwPUi1o71njMp97tlGuDpzo2hvxgNQtP?= =?us-ascii?Q?2ZtocxR49giI/rYry2c8VKl/0wCNFXY9dGakMXhpJ95XSI2LCJexBP/6DTgN?= =?us-ascii?Q?McLq4qw/MVdeW5NtSjWytOfYhBTA7yfZH9Msh0Bnm4/fENnRCYHpP/6lr5MG?= =?us-ascii?Q?oTWyEZzntE1bCZlFQi035GHTk3htX6G/1wf/p+5Tt/XKk2TUjvbNkE7UzNJ8?= =?us-ascii?Q?0qW2lTAXHuRVwMRPhIB7/0UjueEBr3uHwGds5Oa6XadVCnhDj7+fvbFh1kbm?= =?us-ascii?Q?LoJxe1Qm7KaVs6xqqqf9jeuiAwzS4UVSFiNrY6/CvWi5WCutIrGcosmUMLCj?= =?us-ascii?Q?8LNe+H7nZQ=3D=3D?= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-Exchange-RoutingPolicyChecked: G6FSovZs25ANl3jS1pv/yCw/C1QQa2IYmtiiSf4Xty9vj3eKZXyCWavDLLoFClO6GF9xN30UdHrFu6ZByYhpNHciwMhGk4Ucsfu44iAVV8HKdLCqH0NsNu8RsLQVGfXuNPtIJhnoQUe8YMCumvgvHZgB34O1SeychoLXKedB1bAXQUGmAF+tJQDZyvBTdrRJk0oDM5ALPB0CcXNNncfs9r4VaVncMegizxWhtQqfTWf3jaQzawu24UurwgWhPtgbG3+qwX/2eJY/iXLS/UFHGn6/QOGypLkzwoNokVR+kE4dGGZvwkLIkmeJdJDdYC9bAW/qedVtSS16Z0AbTQ8txg== X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM8PR11MB5749.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d75d2f99-07bf-4e32-9e6c-08df15551dab X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Sep 2026 07:19:02.2903 (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: pUSjx7Un0TyC2RzQ+nE2jIE+0nCOu5LO+Jm/Lbbg2i2EPOYC6FVvE2SOWL+O4nEYA3onjyrh4CGVYNJgvpn0V7MxR52uab8xcbtUUIYx7VI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4722 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 This fixes gdb/34380. I added Fixes gdb/34380. to the commit message. Markus. >-----Original Message----- >From: Metzger, Markus T >Sent: Tuesday, September 15, 2026 4:15 PM >To: gdb-patches@sourceware.org >Subject: [PATCH] gdb, infrun: do not discard a step-completed pending >waitstatus > >Consider a scenario with two breakpoints on adjacent instructions: > > bp1 at 0xf00 > bp2 at 0xf01 > >as well as two threads in all-stop-on-top-of-non-stop mode. > >Assume that threads A hits bp1 and we report the breakpoint hit to the >user. When the user continues, we start a step-over for thread A at 0xf00. > >Assume that thread B now hits bp1 and we report the breakpoint hit to the >user. We stop all threads to report the event. Meanwhile, the step-over >of thread A completes, so we save the pending waitstatus (stop_pc=3D0xf01, >currently_stepping=3D1) of thread A. > >When the user continues, clear_proceed_status_thread() discards the >pending step completed waitstatus of thread A, and proceed() starts >another step-over for thread A at 0xf01. > >We skip bp2 for thread A. > >Remove the code in clear_proceed_status_thread() that discards a step >completed waitstatus and let it get handled normally. >--- > gdb/infrun.c | 25 ++----- > gdb/testsuite/gdb.threads/adjacent-bp.c | 48 +++++++++++++ > gdb/testsuite/gdb.threads/adjacent-bp.exp | 86 +++++++++++++++++++++++ > 3 files changed, 139 insertions(+), 20 deletions(-) > create mode 100644 gdb/testsuite/gdb.threads/adjacent-bp.c > create mode 100644 gdb/testsuite/gdb.threads/adjacent-bp.exp > >diff --git a/gdb/infrun.c b/gdb/infrun.c >index b9618fb6422..4ab9f4aaf64 100644 >--- a/gdb/infrun.c >+++ b/gdb/infrun.c >@@ -3100,28 +3100,13 @@ clear_proceed_status_thread (struct thread_info >*tp) > infrun_debug_printf ("%s", tp->ptid.to_string ().c_str ()); > gdb_assert (tp->internal_state () !=3D THREAD_INT_RUNNING); > >- /* If we're starting a new sequence, then the previous finished >- single-step is no longer relevant. */ > if (tp->has_pending_waitstatus ()) > { >- if (tp->stop_reason () =3D=3D TARGET_STOPPED_BY_SINGLE_STEP) >- { >- infrun_debug_printf ("pending event of %s was a finished step. " >- "Discarding.", >- tp->ptid.to_string ().c_str ()); >- >- tp->set_internal_state (THREAD_INT_STOPPED); >- tp->clear_pending_waitstatus (); >- tp->set_stop_reason (TARGET_STOPPED_BY_NO_REASON); >- } >- else >- { >- infrun_debug_printf >- ("thread %s has pending wait status %s (currently_stepping=3D%d).", >- tp->ptid.to_string ().c_str (), >- tp->pending_waitstatus ().to_string ().c_str (), >- tp->control.currently_stepping); >- } >+ infrun_debug_printf >+ ("thread %s has pending wait status %s (currently_stepping=3D%d).", >+ tp->ptid.to_string ().c_str (), >+ tp->pending_waitstatus ().to_string ().c_str (), >+ tp->control.currently_stepping); > } > > /* If this signal should not be seen by program, give it zero. >diff --git a/gdb/testsuite/gdb.threads/adjacent-bp.c >b/gdb/testsuite/gdb.threads/adjacent-bp.c >new file mode 100644 >index 00000000000..e72e674f52a >--- /dev/null >+++ b/gdb/testsuite/gdb.threads/adjacent-bp.c >@@ -0,0 +1,48 @@ >+/* Copyright 2026 Free Software Foundation, Inc. >+ >+ This file is part of GDB. >+ >+ 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 . = */ >+ >+#include >+#include >+ >+static pthread_barrier_t barrier; >+ >+static void * >+test (void *arg) >+{ >+ pthread_barrier_wait (&barrier); >+ int a =3D 0; /* break here. */ >+ int b =3D 0; >+ int c =3D 0; >+ return arg; >+} >+ >+int >+main () >+{ >+ pthread_t th; >+ >+ alarm (500); >+ >+ pthread_barrier_init (&barrier, NULL, 2); >+ pthread_create (&th, NULL, test, NULL); >+ test (NULL); >+ >+ pthread_join (th, NULL); >+ pthread_barrier_destroy (&barrier); >+ >+ return 0; >+} >diff --git a/gdb/testsuite/gdb.threads/adjacent-bp.exp >b/gdb/testsuite/gdb.threads/adjacent-bp.exp >new file mode 100644 >index 00000000000..9e7782c01c2 >--- /dev/null >+++ b/gdb/testsuite/gdb.threads/adjacent-bp.exp >@@ -0,0 +1,86 @@ >+# Copyright 2026 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 that GDB does not skip a breakpoint when a step-over completes >+# while another event leads to a stop. >+ >+standard_testfile >+ >+if {[prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ >+ {debug pthreads}]} { >+ return >+} >+ >+if {![runto_main]} { >+ return >+} >+ >+# Find a sequence of adjacent instructions. >+set bp_line [gdb_get_line_number "break here"] >+set pcs {} >+gdb_test_multiple "info line $bp_line" "" { >+ -re -wrap "starts at address ($hex).*" { >+ pass $gdb_test_name >+ >+ set line "\\s+($hex) \[^\r\n\]+" >+ gdb_test_multiple "x/3i $expect_out(1,string)" "disassemble" { >+ -re -wrap "$line\r\n$line\r\n$line.*" { >+ pass $gdb_test_name >+ >+ lappend pcs $expect_out(1,string) >+ lappend pcs $expect_out(2,string) >+ lappend pcs $expect_out(3,string) >+ } >+ -re -wrap "" { >+ fail $gdb_test_name >+ } >+ } >+ } >+ -re -wrap "" { >+ fail $gdb_test_name >+ } >+} >+ >+# Set breakpoints on adjacent instructions. >+foreach pc $pcs { >+ gdb_breakpoint "\*$pc" >+} >+ >+# Continue from breakpoint to breakpoint. >+set hits [dict create] >+set iter 0 >+gdb_test_multiple "continue" "" { >+ -re -wrap "hit Breakpoint.*" { >+ dict incr hits [get_hexadecimal_valueof "\$pc" invalid "stop $iter"] >+ incr iter >+ send_gdb "continue\n" >+ exp_continue >+ } >+ -re -wrap "$inferior_exited_re normally.*" { >+ pass "$gdb_test_name" >+ } >+} >+ >+# We expect all breakpoints to be hit by both threads. >+foreach pc $pcs { >+ if {[dict exists $hits $pc]} { >+ gdb_assert {[dict get $hits $pc] eq 2} "breakpoint at $pc" >+ dict unset hits $pc >+ } else { >+ fail "breakpoint at $pc" >+ } >+} >+# And no unrelated stops. >+gdb_assert {[dict size $hits] eq 0} "no extra stops" >-- >2.53.0 ________________________________________ Intel Deutschland GmbH = Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany = Tel: +49 (89) 99143-0 = www.intel.de = Managing Directors: Candice Moore, Jeffrey Schneiderman, Ramachandran Sitar= aman Chairperson of the Supervisory Board: Sonja Pierer Registered Seat: Munich Commercial Register B: Amtsgericht Munich HRB 186928 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.