From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id sXTFFVV2fGpIlCAAWB0awg (envelope-from ) for ; Wed, 12 Aug 2026 09:34:13 -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=bVobH16Y; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 550EA1E033; Wed, 12 Aug 2026 09:34:13 -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 DE2DC1E033 for ; Wed, 12 Aug 2026 09:34:12 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 586854BB3B93 for ; Wed, 12 Aug 2026 13:34:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 586854BB3B93 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=bVobH16Y Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by sourceware.org (Postfix) with ESMTPS id 83E034BB3B8A for ; Wed, 12 Aug 2026 13:29:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 83E034BB3B8A 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 83E034BB3B8A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786541343; cv=none; b=Ns4msCyI3JmfyUAxiecfIbjrf0QYrqJ4tNKLtK/Y6ieXV5DV287sE9SUlbpZscebV5nt5racQoTALRvrAew8eZH2hgBUDimdGnvnbk0cKUUHPzXR1vARbHoT5rU2mrsd0d8F4t0pWomVwk43wRFmNjXGkvN2DWzU2078B/x6LLA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1786541343; c=relaxed/simple; bh=AFHu0hp2MqM+0jWUi3vnv4zLm3DoLbgW3LFwNC91VzE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=g+mi/CEdHuyvE4bsl8XOli/5lHz5vRYklXMkIsDw39mPOHeNDW3ohIQM8j0SZTh+ul8NBVp5qrn5ASWSwg8+sxXrfhfBgh0UXuuqQP92p239XxMICghZ8s1RcfO1tnPs0p0F8shYDqmEgdXXWj5/cdm8l5W3Ap6JjD/CGZ+IHu4= 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=bVobH16Y DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83E034BB3B8A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1786541344; x=1818077344; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=AFHu0hp2MqM+0jWUi3vnv4zLm3DoLbgW3LFwNC91VzE=; b=bVobH16Y6CfP/oqy63uyHM5XUPjya5r48ysYtMAQ+UMzVeUqqPMTROtN gEC+cgqnz/Q6XML6LvTymuJBlKmGxEPhq61ihNQy5w7+YaJ+W6fPqL9V/ 3UHtz8S4caKBgG5h75J6cUEIV/I+5nT9qepAYmQf2v6kaHfjN52WAa8dR 225nEHW5SexvzjgtcSvACZL2Z/eui6sIEZ0rYoc3Hxz3CmFNwEEUrrcvM mdiVhsppIJbllIf7TRGiur6uLgBrfiP4nBPpuJrn/8Zhk9/6xiGrlVwv/ vY6ksE18CNoiRlCqH5kGkFwjaAgFDdLzDi+0jcSExKAiZHO6KuACgMrz/ Q==; X-CSE-ConnectionGUID: P0fes0KtSTeqBtc7tpB1hQ== X-CSE-MsgGUID: ZyYGynOCSXCFrqNLCX0Xzw== X-IronPort-AV: E=McAfee;i="6800,10657,11872"; a="97683633" X-IronPort-AV: E=Sophos;i="6.25,219,1779174000"; d="scan'208";a="97683633" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2026 06:29:03 -0700 X-CSE-ConnectionGUID: wwKSYOB6Q7GzDFR1XF6PLw== X-CSE-MsgGUID: /5gOdSC2TkWA/iHdjc2f4Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.25,219,1779174000"; d="scan'208";a="263171372" Received: from gkldtt-dev-004.igk.intel.com (HELO localhost) ([10.123.221.202]) by orviesa008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2026 06:29:01 -0700 From: Markus Metzger To: gdb-patches@sourceware.org Subject: [PATCH v4 17/44] gdb: allow inferiors without threads in all_matching_threads_iterator Date: Wed, 12 Aug 2026 15:27:37 +0200 Message-ID: <20260812132805.380163-18-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 When iterating over all threads, the iterator already skips inferiors without threads. When iterating over a specific inferior, however, the iterator crashes when encountering an inferior without threads. Fix it. --- gdb/thread-iter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/thread-iter.c b/gdb/thread-iter.c index d7ccb176d61..2a424088b6e 100644 --- a/gdb/thread-iter.c +++ b/gdb/thread-iter.c @@ -113,7 +113,7 @@ all_matching_threads_iterator::all_matching_threads_iterator m_mode = mode::ALL_THREADS_OF_INFERIOR; m_inf = find_inferior_pid (filter_target, filter_ptid.pid ()); - if (m_inf != nullptr) + if (m_inf != nullptr && !m_inf->thread_list.empty ()) m_thr = &m_inf->thread_list.front (); } else -- 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.