From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by sourceware.org (Postfix) with ESMTPS id 917703858C52 for ; Thu, 2 Feb 2023 17:50:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 917703858C52 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f54.google.com with SMTP id m5-20020a05600c4f4500b003db03b2559eso2032836wmq.5 for ; Thu, 02 Feb 2023 09:50:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IxSgWprn0bRLBG8WUmGcqFM4jEGCBiiW+RRC1XQAU1k=; b=mPMwm+odsrc0Qfy9Z7KYDQmijPNInBGCF4bviRtE0J6IwTuDF41qJXklH/22Fxxs+h Hk8WIbPymVcTlbeZ9eDp60dEIJSv1W7Ja8nZHcdL6MZ18RnFiCis81vfnksKmxKKaF/K GGVNjkdLfrYGuqB9uZEhcSkKJmXBPcMHxJcTO5Jv0BEgDCBL5GUAKGgo00gAtFz1Gm3J 3ZOmE0gYYLl6sdSJmpZnfTpGCAFrREq1KDFVBzZZqHiT6J3fC1lkbeLrNq09UlSsB5vV BfaoBlDU8Xy7f2dr1/TnSozMQ2J1JNwUm1EN+NzFDrlywpI2f4YmKcl3MNriF84dhKr0 ceMA== X-Gm-Message-State: AO0yUKUHEUmBaCdATagJLNMOD5pbuzchMPRI7XgYRd02qwQcZittliIo NbmJhQigtCwb1WFiexGcaTiYuOC1ZXUO+w== X-Google-Smtp-Source: AK7set/+L6ussmVtPgd8A+Yph3ICFTrUC5fzVYZwZW3ArzgCBzPUTwuwXQvmb6BTUslFw7lc/XL+HQ== X-Received: by 2002:a05:600c:1c0f:b0:3dd:1bd3:4f6d with SMTP id j15-20020a05600c1c0f00b003dd1bd34f6dmr6749516wms.32.1675360222234; Thu, 02 Feb 2023 09:50:22 -0800 (PST) Received: from ?IPv6:2001:8a0:f92b:9e00::1fe? ([2001:8a0:f92b:9e00::1fe]) by smtp.gmail.com with ESMTPSA id o35-20020a05600c512300b003cffd3c3d6csm509611wms.12.2023.02.02.09.50.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Feb 2023 09:50:21 -0800 (PST) Subject: Re: [PATCHv2 1/6] gdb/remote: announce thread exit events for remote targets To: Andrew Burgess , gdb-patches@sourceware.org References: From: Pedro Alves Message-ID: <0f056cdb-aa9c-111a-ed6a-4ac42cd2e1b7@palves.net> Date: Thu, 2 Feb 2023 17:50:18 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,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: On 2023-01-20 9:46 a.m., Andrew Burgess via Gdb-patches wrote: > 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. I had done exactly that in the step over clone/exit series: Centralize "[Thread ...exited]" notifications https://inbox.sourceware.org/gdb-patches/20221212203101.1034916-1-pedro@palves.net/T/#m9f9858077e6b2b817148bfb9c32ec15bec724931 Pedro Alves > > 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); > } >