| Message ID | 20260518183316.127043-1-mohamed.bouhaouel@intel.com |
|---|---|
| Headers |
Return-Path: <gdb-patches-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F053F4BB24C3 for <patchwork@sourceware.org>; Mon, 18 May 2026 18:34:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F053F4BB24C3 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=Xq+oZbwj X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.12]) by sourceware.org (Postfix) with ESMTPS id BE64E4BA79AB for <gdb-patches@sourceware.org>; Mon, 18 May 2026 18:33:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE64E4BA79AB 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 BE64E4BA79AB Authentication-Results: sourceware.org; arc=none smtp.remote-ip=192.198.163.12 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779129219; cv=none; b=GJSNKqqNcwKbByt9D2Jw3aoxP2HMnqBAXRjgn9+EZv/K320XfU7HFRntk+eDh478UZqPI2BnhDivOShQl96Y/gWJWSJmgUUNPmUnk/6uXWaHhwmarEUHkNYl8rKG/44ls2ZnL8UqqlPSCajBxR0q/HLg1O2ZYKrWdXpkySWfEVE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1779129219; c=relaxed/simple; bh=5j7At7kKh5ais5A05Kok4hqYMpxqFFYLCZeqOafFaxI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=vloE9dZk/FqZkvvVimKH8NuKSaZXCWErj1IxeHtE7R3zI/VW96fR1czFHechaxg2dmEgWEBUMzjFxUmRWfciHzIbTFqnVW/uLWzfcwsVnUFBzpRKvgp5l38X2KLsEavxyT7dszulNeXQeYgecGFdnrex7mqACdgajJOGM1kW/qw= ARC-Authentication-Results: i=1; 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=Xq+oZbwj DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE64E4BA79AB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1779129219; x=1810665219; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=5j7At7kKh5ais5A05Kok4hqYMpxqFFYLCZeqOafFaxI=; b=Xq+oZbwjoIuLyL9V81+DTO/t6TFQst9l8QVFQliAaA17JkDCTmH/mBfE rzEhKyGty7IreXjjyflAcLEf5QXUjH284jVyG8+padrEPUzcsl2lg6J9r jtIheg09DGD+dvB0Mqgp5SztmsleUVRLn6ghMnlh2ZxD0/gTBx8o1U0zg xQB0/Xzq1BuLJfJqmmqyAd5H+LctDDHdosEyUEKJTN1BceWsCDnQtXZDG XvOwK2qPJRlN6LQv7HDpglw4Y9Qobs4lD8K0qhZ9LwYHi173ZU/tOXQZW llneDNKaKt2R9o8R5cv7OC1jBUJuSQWKK40tSj/vfCPiG5vY2OPvt23cy A==; X-CSE-ConnectionGUID: LoSerdn2Rka00HD6F7WneA== X-CSE-MsgGUID: lbnFnzsVTL+ph8QPFwWexA== X-IronPort-AV: E=McAfee;i="6800,10657,11790"; a="83849735" X-IronPort-AV: E=Sophos;i="6.23,242,1770624000"; d="scan'208";a="83849735" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2026 11:33:35 -0700 X-CSE-ConnectionGUID: UmSAdg2NSbWI8NaMx8X+HQ== X-CSE-MsgGUID: JRqO3cE2SXiG7OAkVdtnRQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,242,1770624000"; d="scan'208";a="238681028" Received: from cwhite-mobl.ger.corp.intel.com (HELO localhost) ([10.245.114.180]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2026 11:33:34 -0700 From: Mohamed Bouhaouel <mohamed.bouhaouel@intel.com> To: gdb-patches@sourceware.org Cc: mohamed.bouhaouel@intel.com, stephan.rohr@intel.com, markus.t.metzger@intel.com Subject: [PATCH 00/11] Enable non-stop mode by default for remote targets Date: Mon, 18 May 2026 20:32:56 +0200 Message-ID: <20260518183316.127043-1-mohamed.bouhaouel@intel.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_NONE, TXREP shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org |
| Series |
Enable non-stop mode by default for remote targets
|
|
Message
Bouhaouel, Mohamed
May 18, 2026, 6:32 p.m. UTC
From: "Bouhaouel, Mohamed" <mohamed.bouhaouel@intel.com>
This series makes remote targets operate in non-stop mode if the target
announces QNonStop support and 'maint set target-non-stop’ is set to
‘auto', aligning the behavior with the Linux native target.
When non-stop is forced on at startup, GDB has no selected thread when DAP
emits a 'continued' or 'stopped' event, and gdb.selected_thread() returns None.
The fix follows the DAP spec: default threadId to 0 for 'continued' (required)
and omit it for 'stopped' (optional) if no thread is selected.
We could not validate this against a real DAP-driven GUI, but the full
DAP testsuite passes.
- Open
'gdb.threads/current-lwp-dead.exp' fails intermittently with this series.
The test deliberately crafts a scenario where the previously-selected LWP has
already exited by the time a breakpoint hits in another LWP (using clone()
without CLONE_THREAD, so GDB still sees the new task as a thread of the same
inferior via PTRACE_EVENT_CLONE). With a non-stop remote target, GDB
processes the parent's exit event while another LWP is being single-stepped,
and the resulting thread-state churn fails the test.
Bouhaouel, Mohamed (8):
gdb, remote: fix assertion on reconnect to non-stop target
gdb, remote: fix async handler assertion on reconnect to non-stop
target
gdb, remote: fix "info program" after reconnect to non-stop target
gdb, remote: fix crash when accessing removed events
gdb, testsuite: handle async close in monitor-exit-quit.exp
gdb, testsuite: update attach-deleted-exec.exp to handle async
messages
gdb, testsuite: add kfails for step-over-process-exit.exp
gdb, remote: implement always_non_stop_p for remote target
Markus Metzger (1):
gdb, record: fix assertion when remote target is set to non-stop
Rohr, Stephan (2):
gdb, remote: fix ptid matching for process-wide stop events
gdb, dap: fix DAP events if no thread is selected
gdb/python/lib/gdb/dap/events.py | 15 ++++-
gdb/record-full.c | 3 +-
gdb/remote.c | 59 ++++++++++++++-----
.../gdb.base/attach-deleted-exec.exp | 59 +++++++++++--------
.../gdb.server/monitor-exit-quit.exp | 9 ++-
.../gdb.threads/step-over-process-exit.exp | 6 ++
6 files changed, 106 insertions(+), 45 deletions(-)
Comments
Kindly pinging. Thanks! --Mohamed > -----Original Message----- > From: Bouhaouel, Mohamed <mohamed.bouhaouel@intel.com> > Sent: Monday, 18 May 2026 20:33 > To: gdb-patches@sourceware.org > Cc: Bouhaouel, Mohamed <mohamed.bouhaouel@intel.com>; Rohr, Stephan > <stephan.rohr@intel.com>; Metzger, Markus T > <markus.t.metzger@intel.com> > Subject: [PATCH 00/11] Enable non-stop mode by default for remote targets > > From: "Bouhaouel, Mohamed" <mohamed.bouhaouel@intel.com> > > This series makes remote targets operate in non-stop mode if the target > announces QNonStop support and 'maint set target-non-stop’ is set to > ‘auto', aligning the behavior with the Linux native target. > > When non-stop is forced on at startup, GDB has no selected thread when > DAP > emits a 'continued' or 'stopped' event, and gdb.selected_thread() returns > None. > The fix follows the DAP spec: default threadId to 0 for 'continued' (required) > and omit it for 'stopped' (optional) if no thread is selected. > We could not validate this against a real DAP-driven GUI, but the full > DAP testsuite passes. > > - Open > > 'gdb.threads/current-lwp-dead.exp' fails intermittently with this series. > The test deliberately crafts a scenario where the previously-selected LWP has > already exited by the time a breakpoint hits in another LWP (using clone() > without CLONE_THREAD, so GDB still sees the new task as a thread of the > same > inferior via PTRACE_EVENT_CLONE). With a non-stop remote target, GDB > processes the parent's exit event while another LWP is being single-stepped, > and the resulting thread-state churn fails the test. > > Bouhaouel, Mohamed (8): > gdb, remote: fix assertion on reconnect to non-stop target > gdb, remote: fix async handler assertion on reconnect to non-stop > target > gdb, remote: fix "info program" after reconnect to non-stop target > gdb, remote: fix crash when accessing removed events > gdb, testsuite: handle async close in monitor-exit-quit.exp > gdb, testsuite: update attach-deleted-exec.exp to handle async > messages > gdb, testsuite: add kfails for step-over-process-exit.exp > gdb, remote: implement always_non_stop_p for remote target > > Markus Metzger (1): > gdb, record: fix assertion when remote target is set to non-stop > > Rohr, Stephan (2): > gdb, remote: fix ptid matching for process-wide stop events > gdb, dap: fix DAP events if no thread is selected > > gdb/python/lib/gdb/dap/events.py | 15 ++++- > gdb/record-full.c | 3 +- > gdb/remote.c | 59 ++++++++++++++----- > .../gdb.base/attach-deleted-exec.exp | 59 +++++++++++-------- > .../gdb.server/monitor-exit-quit.exp | 9 ++- > .../gdb.threads/step-over-process-exit.exp | 6 ++ > 6 files changed, 106 insertions(+), 45 deletions(-) > > -- > 2.43.0 Intel Deutschland GmbH Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany Tel: +49 89 991 430, www.intel.de Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell Chairperson of the Supervisory Board: Nicole Lau Registered Seat: Munich Commercial Register: Amtsgericht Muenchen HRB 186928
On 2026-05-18 19:32, Mohamed Bouhaouel wrote: > From: "Bouhaouel, Mohamed" <mohamed.bouhaouel@intel.com> > > This series makes remote targets operate in non-stop mode if the target > announces QNonStop support and 'maint set target-non-stop’ is set to > ‘auto', aligning the behavior with the Linux native target. This wasn't done before for a reason. It's that 'maint set target-non-stop on’ does not support all the features the all-stop variant of the remote protocol. Specifically, off the top of my head: - there is no alternative to the O packet. Those can be sent while the target is running as if they were a stop reply, but that doesn't work in non-stop mode. See remote_target::wait_as: case 'O': /* Console output. */ - remote file I/O support does not work. Similar to the O packet. See remote_target::wait_as: case 'F': /* File-I/O request. */ - packet efficiency. With non-stop, GDB suspends and resumes each thread individually. - on the resumption side, that is mitigated by GDB coalescing vCont packets. when you e.g. "continue", gdb core does one target_resume call per thread, but the remote target backend does not resume the thread immediately. Instead, it defers the resume until infrun calls target_commit_resumed(). - on the stopping side, however, there is no support for aggregation. The server reports each thread stop with its own separate stop reply notification. So it's plausible that there may some stubs out there that do support non-stop mode, but they also support e.g., file I/O. Enabling non-stop by default for those might not be the correct choice. Or maybe the performance degrades visibly. Maybe there are some mitigating factors, like, maybe it won't matter that much if we have displaced stepping. My point is, this needs to be a considered change, not just "to align with linux". Pedro Alves