From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id CSvSJ7TVKmqOswEAWB0awg (envelope-from ) for ; Thu, 11 Jun 2026 11:35:16 -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=UZWBXDF7; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 9E8551E098; Thu, 11 Jun 2026 11:35:16 -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 F270A1E070 for ; Thu, 11 Jun 2026 11:35:15 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0D30D4BA2E26 for ; Thu, 11 Jun 2026 15:35:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D30D4BA2E26 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=UZWBXDF7 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) by sourceware.org (Postfix) with ESMTPS id BE9324BA2E09 for ; Thu, 11 Jun 2026 15:34:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE9324BA2E09 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=tempfail smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BE9324BA2E09 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=198.175.65.9 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781192069; cv=none; b=hcFpTk0GWx/WEumtq/7F3azxHVRU4RRxV9RWnnkpOstn1qzogdKNnEmPMWqKXOAy1cUoa4vmlRSqRDuNnhcKkcMXowlYF1BTBwoDmMyg6iSVCWgZs54E88z15graRlq8ABoRt+NbLxbdTsTOZnDLE1bU2inay9OjhlvI/LO6ido= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781192069; c=relaxed/simple; bh=Uv/bOrrP3cUkKmluyz/CnySb9ArdZ5fYxa3JakiaRC4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=oIIjprU8aINbNfsBp9OEh14Q/UNVRbl9rMV3+2SH4AW3w0u00DJWiQ4Aw1VGUPUao7175RpW2wDBnGzfUdcUFeonsDhh8kacPTnc8xT9gQqagezHdopTIMpmXQlAdgz+oV3qtupAyRmGDezfGEPPpbgobn1q4iyyQxYdH3T3j9U= 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=UZWBXDF7 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BE9324BA2E09 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1781192064; x=1812728064; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Uv/bOrrP3cUkKmluyz/CnySb9ArdZ5fYxa3JakiaRC4=; b=UZWBXDF7etYqaGOYWjHiPZ58fU3AckC56vZK2P7kkTXi2XQjFCneCr2b O17XwUVFluSB09D3KWcBVnhdS1mipGHWf6YNAj2rtcEUiFap2vgMFW7S8 zrWiURqBDIZUr/V/i9ESfzovg+bSrblv8s7jLqiBEH9jKd2QAh+EKTvVg /H0pnd3KyGSrUk0SlwHkDSJts2tgNvHL9In2EJXiN0pXLGzFgW9DuEUqx Oc1ER/OF9iN682wW+d13BJ+amq9EzPfU3rxsGnnTZQDD89EWd7wPXW/Cv /iVQ1dI0fO5FGg4fG779mJrTFL/z/5jbZK82GmExzJ18YWf5ySAZrEVwF g==; X-CSE-ConnectionGUID: t+ufnbdDROSsr1i28cLYvg== X-CSE-MsgGUID: IC3jwZ+OTkueSp2qC7CWbw== X-IronPort-AV: E=McAfee;i="6800,10657,11813"; a="104675546" X-IronPort-AV: E=Sophos;i="6.24,199,1774335600"; d="scan'208";a="104675546" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2026 08:34:23 -0700 X-CSE-ConnectionGUID: 6f7EwQIxSYeIb1vu8bTymg== X-CSE-MsgGUID: H0Afgm7XSdS8hBy+7BE3fg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.24,199,1774335600"; d="scan'208";a="242117137" Received: from womilian-mobl.ger.corp.intel.com (HELO localhost) ([10.245.82.28]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2026 08:34:20 -0700 From: Mohamed Bouhaouel To: gdb-patches@sourceware.org Cc: markus.t.metzger@intel.com, stephan.rohr@intel.com, aburgess@redhat.com, mohamed.bouhaouel@intel.com Subject: [PATCH v2 04/11] gdb, remote: fix "info program" after reconnect to non-stop target Date: Thu, 11 Jun 2026 17:32:24 +0200 Message-ID: <20260611153232.3011-5-mohamed.bouhaouel@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260611153232.3011-1-mohamed.bouhaouel@intel.com> References: <20260611153232.3011-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 d08d52ecfe1..2c6c686ddeb 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -5165,6 +5165,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