From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2VnIMgBn8mmGNgQAWB0awg (envelope-from ) for ; Wed, 29 Apr 2026 16:16:00 -0400 Received: by simark.ca (Postfix, from userid 112) id CA4D41E093; Wed, 29 Apr 2026 16:16:00 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.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 61F221E093 for ; Wed, 29 Apr 2026 16:16:00 -0400 (EDT) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id DCE7F4BBCDC0 for ; Wed, 29 Apr 2026 20:15:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DCE7F4BBCDC0 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by sourceware.org (Postfix) with ESMTPS id 29E464BBCDBE for ; Wed, 29 Apr 2026 20:15:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 29E464BBCDBE Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 29E464BBCDBE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777493736; cv=none; b=NUGGSOxkwBEZGTm8QDstQbZxrdGRNg4XSKn0Q0KSh0sxs4TVgLhnvg6f2/S/H+SBjFFyyOJAuaFKauNe7sRVA2/QvuvFNqXnT9Ua4AJCHTU4d1r0A2LkAzKpSZZTjd4dRZadu/8+HA37DKPTu+C0gCU0f0S3yiqeq9bz+lYTEI4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777493736; c=relaxed/simple; bh=OP3sIAVolTeV2g800n3ySbZ9DoEOv2FOFUJK1F1CV+A=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=SXKYEkW+G1IoHWM5D9Jh3keCw3zWTgU4cEf0KPq+qPvjP65Ny0VNabQ4/uxfYMBNmW4fh9UMibVZFF938HKaNFlIXkeJH5DzmzIaS/Xl31quuPbRguW2X32Ztf6ePDhoGLkmkuqM1SEwb/lCBJ5Os8R87MsvfLwNQXVk8njO+ZI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 29E464BBCDBE Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-488a14c31eeso1133645e9.0 for ; Wed, 29 Apr 2026 13:15:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777493735; x=1778098535; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ovlHYE7svWZFepx+ryXNwO7/14itZ8TvaGeO+0sWxI8=; b=esMLcWk5WNljV/NKQtqGAQ9KrbcbqP5oFgnRrMe9nngyGtZuuwj1X0IxesNvt2J2Cv RZ9L2eZ8f7MSXYdrqbTb7leiWmaJ3B+MQa37ziOsQDDJzCBq8OFmq7XW0YInBoEKD9KE 70aoauffNJguupPbroCmZC1JcXR5uum0vZDM6XJBipk+uYAP3sJruqaZi5RLURCAyaDu 3lBfgNQY7WbUUB3sWfqPMvh37hs6xO8pgO00CuKY+b860O3HkJcS51gzEiZAJe2xUDII 6IY2PLmjwqRbPfQaBsc4urUHE6iXqeVuS96DfUnIkZUTmh3gjIUxxF4gPj5Vqf+zaJOU o+Dw== X-Gm-Message-State: AOJu0YxEKfByxepZSGPwDGNdCOYw59FSqNA0LLvCYE1hQheKIZaiKIdU y1qe38BqiCxSUBQUJ9Uc+gaMN3dOJ+tZSRPAPFQ4LC1T2oA7GRjvA8DArs5iLw== X-Gm-Gg: AeBDievBHe1v/An42kYfj0JCjnOe0axKQ3pEY3g8n4JOJG/KkcN0ECXzinu/R1Y0UK+ 6NGvi6iNZwNT1C7EuB2CAB21Uweh0Mi0dvQOAKBciLcRMq1Hq4uSb9mdrHetP1kwt0ly0PJ4fDL WTKS4MZ3CB89++9Jadf1bUVO0anF0F28z62927w8tvKeZOddp3SoX8BmVtueepcTjty6ldUWJgB Ixe1PQhRZRfjXOHcFvw9Y+4IzXf1FjyORCEFsi6dk+mIjAWEt3oCeqgMIxYicE07Kv/AMYElRTA PHBA8C1kSDmTMka/hiTfCpvIJLOLghZf/OK370jRhJMsCVbM83MZxtgIJuCYdi651rpYo9ZWBar ZL7+tcT4OhWRY4zhBB7rxNs4z5qJg6AqqL7sXOEzZUXhqmR+cA3xdlij6nBmPvMYsaKbYMiwxxr e+GPNr45FNNy0Zfmg5dPdZu3Lb0DPuuLs= X-Received: by 2002:a05:600c:4e87:b0:489:1f3e:5f69 with SMTP id 5b1f17b1804b1-48a8451ccf2mr117605e9.18.1777493734542; Wed, 29 Apr 2026 13:15:34 -0700 (PDT) Received: from localhost ([2001:8a0:facb:a800:f22f:591f:e700:e91]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-447b120bdefsm8052073f8f.0.2026.04.29.13.15.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 29 Apr 2026 13:15:34 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v3 07/11] Windows gdb: extra thread info => show exiting Date: Wed, 29 Apr 2026 21:15:03 +0100 Message-ID: <20260429201507.480870-8-pedro@palves.net> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260429201507.480870-1-pedro@palves.net> References: <20260429201507.480870-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Now that we have easy access to each thread's last event, we can easily include some extra info in "info threads" output related to each thread's last event. This patch makes us show whether the thread is exiting, or causing a whole-process exit. This is useful when multiple threads hit events at the same time, and the thread/process exit events are still pending until the user re-resumes the program. This is similar to how linux-thread-db.c also shows "Exiting" in its target_extra_thread_info implementation. This will be relied on by the testcase added by the following patch. Approved-By: Tom Tromey Change-Id: I493b7ea3e14574dc972b1341eb5062fbbfda1521 commit-id:51b6d728 --- gdb/windows-nat.c | 21 +++++++++++++++++++++ gdb/windows-nat.h | 2 ++ 2 files changed, 23 insertions(+) diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index 6f3803c887b..638e87f6f60 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -3345,6 +3345,27 @@ windows_nat_target::thread_name (struct thread_info *thr) return th->thread_name (); } +/* Implementation of the target_ops::extra_thread_info method. */ + +const char * +windows_nat_target::extra_thread_info (thread_info *info) +{ + windows_thread_info *th = windows_process->find_thread (info->ptid); + + if (!th->suspended) + return nullptr; + + if (th->pending_status.kind () == TARGET_WAITKIND_THREAD_EXITED + || th->last_event.dwDebugEventCode == EXIT_THREAD_DEBUG_EVENT) + return "exiting"; + else if (th->pending_status.kind () == TARGET_WAITKIND_EXITED + || th->pending_status.kind () == TARGET_WAITKIND_SIGNALLED + || th->last_event.dwDebugEventCode == EXIT_PROCESS_DEBUG_EVENT) + return "exiting process"; + + return nullptr; +} + /* Implementation of the target_ops::supports_non_stop method. */ bool diff --git a/gdb/windows-nat.h b/gdb/windows-nat.h index 5ef68dff274..2d6981ada0b 100644 --- a/gdb/windows-nat.h +++ b/gdb/windows-nat.h @@ -214,6 +214,8 @@ struct windows_nat_target : public inf_child_target bool thread_alive (ptid_t ptid) override; + const char *extra_thread_info (thread_info *info) override; + std::string pid_to_str (ptid_t) override; void interrupt () override; -- 2.53.0