From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cTsFEzicS2pKvCkAWB0awg (envelope-from ) for ; Mon, 06 Jul 2026 08:14:48 -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=leMM2Nm4; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 49ED11E098; Mon, 06 Jul 2026 08:14:48 -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 7B5A51E070 for ; Mon, 06 Jul 2026 08:14:47 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D4B884BA2E35 for ; Mon, 6 Jul 2026 12:14:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4B884BA2E35 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=leMM2Nm4 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) by sourceware.org (Postfix) with ESMTPS id 151964BA2E1F for ; Mon, 6 Jul 2026 12:12:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 151964BA2E1F 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 151964BA2E1F Authentication-Results: sourceware.org; arc=none smtp.remote-ip=198.175.65.21 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783339968; cv=none; b=KJF44n8N2XbW67+BSDvgni4rpEqNouRZetXMYdGWs1PeUr6AUFAv1fficD+jWKLTelvl60p3Vp5AkPYR/+lPCMM9XT6/cvVe7hCWiqXnFpUAtXVQ01BI2taiPaPKU+6f4E0qPcCu6MMJkWyz22DRSkxobk9BZTtWa+JeoPK5GTw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1783339968; c=relaxed/simple; bh=GEKdpi2GP6gLqzv7CM7FMpN6sqKi/+VTNo8ej7OwD1U=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=j8k6v4+afVN4ZC/gm314fFMFb/m0kQDBVuP/Qq4P693xXzrb5qLQfMDXc0GUXSYzjjXcKZ0LQsMX+hOKRsFa4xn0gHdXBkVQW1dgzWQh3Tm+W+CgMLsR/EIA1dyvEnJPTSyTEAQByE5RwEqJxEJkBtTib2p3cX3SlPJ6bGLpbBg= 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=leMM2Nm4 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 151964BA2E1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1783339968; x=1814875968; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GEKdpi2GP6gLqzv7CM7FMpN6sqKi/+VTNo8ej7OwD1U=; b=leMM2Nm4OvkQR1GDUzpxRsrhy9XsB1SQCcQW0U5ECaZD5vylch2rfT4p 70TtKY/qAy7VnGGrfQvBrIc6r+M453zL8z0smqGQN/rMgaGdxNCuvlnnz IiXL0sdqainG0fLArJglFxOdTFPypBeaQJFEXcsmCg30wuxpVRAUQkDw9 +NzgpI7H27AyraEN4O7b+Os1ARh4F6xpRw+X5zXzqEQtbjphndjqCLTJN a/4BduFVaY4+RsyxdQkxQnxvJ8zTOEYvVVP6ZAWb9SwZfxjw0pmlH5hxm ucWn+PciZ1qWL5Mgh4hp5BHLaxnnI5RLt15QYsolr5be4ILdFOFCaH9ZP A==; X-CSE-ConnectionGUID: V2YHLfn3SB6NARM2yOAKUg== X-CSE-MsgGUID: TCd9YLM0RiORJGp9Au1OUg== X-IronPort-AV: E=McAfee;i="6800,10657,11838"; a="83834550" X-IronPort-AV: E=Sophos;i="6.25,149,1779174000"; d="scan'208";a="83834550" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2026 05:12:48 -0700 X-CSE-ConnectionGUID: /bJip5fCRHqYfus7KcfgAg== X-CSE-MsgGUID: lPEYkPW7TcGnwgqHwEtBrQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,149,1779174000"; d="scan'208";a="255637950" Received: from unknown (HELO localhost) ([10.245.114.180]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2026 05:12:46 -0700 From: Mohamed Bouhaouel To: gdb-patches@sourceware.org Cc: stephan.rohr@intel.com, markus.t.metzger@intel.com, pedro@palves.net, aburgess@redhat.com Subject: [PATCH v3 04/11] gdb, remote: fix "info program" after reconnect to non-stop target Date: Mon, 6 Jul 2026 14:11:17 +0200 Message-ID: <20260706121124.18784-5-mohamed.bouhaouel@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260706121124.18784-1-mohamed.bouhaouel@intel.com> References: <20260706121124.18784-1-mohamed.bouhaouel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 From: "Bouhaouel, Mohamed" After reconnecting to a non-stop remote target that has stopped threads, "info program" incorrectly reports "The program being debugged is not being run" instead of showing the stop information. This happens because the previous_thread global is not updated when processing initial stop replies. Fix by calling update_previous_thread () after set_last_target_status () in print_one_stopped_thread (). Scenario: - Connect to non-stop remote target - Thread receives signal (e.g., SIGUSR1) and stops - Disconnect and reconnect - "info program" reports "not being run" (FAIL) Reproducible when running gdb.threads/reconnect-signal.exp, on native-gdbserver or native-extended-gdbserver with target-non-stop enabled. export GDBFLAGS="-iex \"maint set target-non-stop on\"" make check TESTS="gdb.threads/reconnect-signal.exp" \ RUNTESTFLAGS="--target_board=native-gdbserver GDBFLAGS='$GDBFLAGS'" --- gdb/remote.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/remote.c b/gdb/remote.c index 646af2ffca6..f6178caf7a1 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -5105,6 +5105,7 @@ remote_target::print_one_stopped_thread (thread_info *thread) /* For "info program". */ set_last_target_status (this, thread->ptid, ws); + update_previous_thread (); if (ws.kind () == TARGET_WAITKIND_STOPPED) { -- 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