From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KaYzIXd1fGo3kyAAWB0awg (envelope-from ) for ; Wed, 12 Aug 2026 09:30:31 -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=SIeoMf8i; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 8057E1E033; Wed, 12 Aug 2026 09:30:31 -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 91DDA1E033 for ; Wed, 12 Aug 2026 09:30:30 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D85024BB3BAB for ; Wed, 12 Aug 2026 13:30:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D85024BB3BAB 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=SIeoMf8i Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by sourceware.org (Postfix) with ESMTPS id A24FD4BB24FD for ; Wed, 12 Aug 2026 13:28:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A24FD4BB24FD 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 A24FD4BB24FD Authentication-Results: sourceware.org; arc=none smtp.remote-ip=192.198.163.10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786541331; cv=none; b=AQ+CrPuluN7H+0V8AgZatjhecN+Rybi3B2Oa7GLMW5pYXHDUxWNZ37DEanKiReSUPZVDf8yjyJ4t4jkIAk1T+h2mcUq9NkS9VUmeLk4HTtzKrnY6sStR3rukBSlojagk0gX1fwFXtf5Vmy0WLqya+wv6RRznAbxef5ppgwOxuWE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786541331; c=relaxed/simple; bh=DfOmZEae2RMlDtAeNLFeEZiY7JxpSJ6ZU3x30qHe6RE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qXS7kjzK7jdTyapQoxTdHyw1Fj+/YbK23oqSig20ZXcw0UbUh1hVfy0aUtd3KhKON2tpg6wVkkhGZuMVTShqL8rENkRmyG73GRWJZtENu4hJw0YdRIybxV8jHzTbiOvtRIrzI9s/dAKo/h+kfe1utX8tACBKyGIK+ewtdcFONnc= 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=SIeoMf8i DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A24FD4BB24FD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786541332; x=1818077332; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=DfOmZEae2RMlDtAeNLFeEZiY7JxpSJ6ZU3x30qHe6RE=; b=SIeoMf8iJ53YYSWyxWUCdXRYkI2XefMzloKYpBuhtNC06UQIJCYzswIN V0t0B24MdGvYIC3L7Nf1cwUy2yP8cSC5llLktbg5Q1QivUH61pxVAIo59 Ep3pVYisgsbMSt/prE/iUCbiMbrI3dD+pkIDrNZfOA+q/Ppb/tQOrGSbs Koa/GrVdQ5Yd9mkd/haTBJRNB1bl8RYN2jT2lXqt5B7TNtiio0NGzJxxq 14+WGqBzheDwJEoKUMiLO3+qYNO+u6RFXqCEskn6tZ7bOXJYE483TW0nG jb+hSPqk3sTFps8lFyygSaRIBxRrtQXry+srfnOy6vo6QlGHMc4k92Q+y A==; X-CSE-ConnectionGUID: 10QsdOr/Su23kB+OLAR9xA== X-CSE-MsgGUID: SgEFWuM6QYe159+XfYCzDg== X-IronPort-AV: E=McAfee;i="6800,10657,11872"; a="98457691" X-IronPort-AV: E=Sophos;i="6.25,219,1779174000"; d="scan'208";a="98457691" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2026 06:28:51 -0700 X-CSE-ConnectionGUID: eQoNPjB0T6qdg78UNN+ewQ== X-CSE-MsgGUID: yOZ72+MWSwKAE9/4Lu7nzQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,219,1779174000"; d="scan'208";a="267509992" Received: from gkldtt-dev-004.igk.intel.com (HELO localhost) ([10.123.221.202]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2026 06:28:50 -0700 From: Markus Metzger To: gdb-patches@sourceware.org Subject: [PATCH v4 13/44] gdbserver: move dlls_changed initialization on attach into targets Date: Wed, 12 Aug 2026 15:27:33 +0200 Message-ID: <20260812132805.380163-14-markus.t.metzger@intel.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260812132805.380163-1-markus.t.metzger@intel.com> References: <20260812132805.380163-1-markus.t.metzger@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 This prepares for a new target that may not select a thread or process during attach and the initial wait. --- gdbserver/linux-low.cc | 5 +++++ gdbserver/server.cc | 6 ------ gdbserver/win32-low.cc | 7 +++++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc index f1be62225e2..f14e5b1dc32 100644 --- a/gdbserver/linux-low.cc +++ b/gdbserver/linux-low.cc @@ -1213,6 +1213,11 @@ linux_process_target::attach (unsigned long pid) error (_("Cannot attach to process %ld: %s"), pid, reason.c_str ()); } + /* Don't report shared library events after attaching, even if some + libraries are preloaded. GDB will always poll the library list. + Avoids the "stopped by shared library event" notice on the GDB + side. */ + proc->dlls_changed = false; open_proc_mem_file (proc); /* Don't ignore the initial SIGSTOP if we just attached to this diff --git a/gdbserver/server.cc b/gdbserver/server.cc index 4a727c465f0..471d6782091 100644 --- a/gdbserver/server.cc +++ b/gdbserver/server.cc @@ -3365,12 +3365,6 @@ handle_v_attach (char *own_buf) { if (attach_inferior (pid) == 0) { - /* Don't report shared library events after attaching, even if - some libraries are preloaded. GDB will always poll the - library list. Avoids the "stopped by shared library event" - notice on the GDB side. */ - current_process ()->dlls_changed = false; - if (non_stop) { /* In non-stop, we don't send a resume reply. Stop events diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc index 7629beca213..935ac6657f7 100644 --- a/gdbserver/win32-low.cc +++ b/gdbserver/win32-low.cc @@ -373,6 +373,13 @@ do_initial_child_stuff (HANDLE proch, DWORD pid, int attached) = inferior_started_by_cygwin (pid, attached); #endif + /* Don't report shared library events after attaching, even if some + libraries are preloaded. GDB will always poll the library list. + Avoids the "stopped by shared library event" notice on the GDB + side. */ + if (attached) + proc->dlls_changed = false; + windows_process.child_initialization_done = 1; } -- 2.43.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 Sitaraman 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.