From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 114E53858433 for ; Fri, 20 Jan 2023 09:46:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 114E53858433 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674208004; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=4DHcahhUHwf1MnlMpWZRyFzq1B0Ijhy7E/rTsZnyAFc=; b=N3GV3BM3STKd0e8O+WFV8m/S1SunIMWwmBkBHTQ1VuBTCjrgXQA3lQ3Oo9ZMICJ2Sff+h0 clHhoq+Zil1oawy2Y1QIinjQbcu2ZsMM0f784Lms1/P2307wk16g5yiUEFinwHRi0SWPL5 PEBR/Cl8GuNHj9voQJcA9LNXLtSm65E= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-441-A9hL-hNNNR6FSlp8_3QeBA-1; Fri, 20 Jan 2023 04:46:37 -0500 X-MC-Unique: A9hL-hNNNR6FSlp8_3QeBA-1 Received: by mail-qk1-f197.google.com with SMTP id bp33-20020a05620a45a100b007090e2e1b0cso1507303qkb.16 for ; Fri, 20 Jan 2023 01:46:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4DHcahhUHwf1MnlMpWZRyFzq1B0Ijhy7E/rTsZnyAFc=; b=sNFPvBYRVCJ8He6RabyXiWPrKYgu/HfNS8YvzLgSS9xZriGReGNfikDwmPRk3T39ML gXyQ70q00jrDwnoTAJU1iOJoea3SHsoo6FP6G697bmzHOjkI18NO/zrQh8xMc6HgUv9H 37mt1qTh/iD+6UDDug3nOY36rjNdN8x6aQVr5XGca9KzimfTvYJWVB1zvPRc7aHQQhPd hcA3cZ/7DpHtSBgKm+t13RyyuST8fpo/y90+zHgvRnW2QovpUB8w/4asM/LTVFNORLxN M20SXBGCCu4IfEV309k8K4miEoT79VaMSkltczMjGUC7V2DcpOPc9DMfKji/YfLqduQ5 7/fA== X-Gm-Message-State: AFqh2krODyeppVggt5IoXuhIlTOKCe7sTiJmGxOlVC5DuF+BzswqNUaK MNv8SLnnbCZnffW0lKgwozDbR1UJdro4hyPNo2IAqXMDDto1T2tb67UTlHwUr+O9NMkv6ifmCk1 vEAggt4LS/PYFlJh9swia9EUg1a1zRBj73eZY3vcxWXZBfDRiK/qQAozlLpTEiCgcooRaK89/og == X-Received: by 2002:ac8:1346:0:b0:3b6:2b5c:97e5 with SMTP id f6-20020ac81346000000b003b62b5c97e5mr20553013qtj.17.1674207997292; Fri, 20 Jan 2023 01:46:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXvPbu+QIlIuKgS3yXMofW51ZYHjEYWVj8bJqRmW+CZcuf1lMq4JTvypg5cHrXPWqYU7Sl2azA== X-Received: by 2002:ac8:1346:0:b0:3b6:2b5c:97e5 with SMTP id f6-20020ac81346000000b003b62b5c97e5mr20552990qtj.17.1674207996962; Fri, 20 Jan 2023 01:46:36 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id d13-20020ac8668d000000b003b637642405sm6062337qtp.5.2023.01.20.01.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 01:46:36 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2 1/6] gdb/remote: announce thread exit events for remote targets Date: Fri, 20 Jan 2023 09:46:24 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: For some reason the "[Thread XXXX exited]" messages are not printed inside thread.c from functions like delete_thread, etc as might be expected. Instead, each target seems to print the message before calling delete_thread. This doesn't seem ideal, and I can't help but feel that the printing should be moved into thread.c, however, I have not tried to do that in this commit, as I suspect there will be lots of fallout that needs fixing up. Instead, in this commit, I have added the printing code into remote.c, so that the remote target will now correctly tell the user when a thread has exited. This fixes some test failures in gdb.threads/thread-specific-bp.exp when run with the native-gdbserver and native-extended-gdbserver board. When using the native-extended-gdbserver board I still see 1 test failure, but I think this is not related to the issue fixed in this commit, so I'm ignoring that for now. --- gdb/remote.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdb/remote.c b/gdb/remote.c index 0a6e293c095..4a508981a96 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -3977,6 +3977,10 @@ remote_target::update_thread_list () if (has_single_non_exited_thread (tp->inf)) continue; + if (print_thread_events) + gdb_printf (_("[%s exited]\n"), + target_pid_to_str (tp->ptid).c_str ()); + /* Not found. */ delete_thread (tp); } -- 2.25.4