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 D52433858C52 for ; Sat, 4 Feb 2023 15:46:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D52433858C52 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=1675525568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=hMoKwCtRjszxiuYHDF4G7xjNYY8eYtUpwhe9MOaDdHE=; b=cjg5qLvioLP6bkPOyxLHehbOAkClSMKHei+/hK6BNJ5wzue0f7s26+z1cMn7yEe4gbOJvo mB2zEbH1CrhG57sKI5W5qzWBIuH9S4hOgPfHY1jC308c2PfD6opKG8ImiLcy52KkazuEz1 uo/SNrJv9bj9vaYs0dv9sE50HKqz1MA= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-621-0niQxQWOORy9Rmt7KwTGsA-1; Sat, 04 Feb 2023 10:46:07 -0500 X-MC-Unique: 0niQxQWOORy9Rmt7KwTGsA-1 Received: by mail-qt1-f198.google.com with SMTP id x16-20020ac87ed0000000b003b82d873b38so4129935qtj.13 for ; Sat, 04 Feb 2023 07:46:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hMoKwCtRjszxiuYHDF4G7xjNYY8eYtUpwhe9MOaDdHE=; b=HLWTdGdl1H3DCEB8kK2bxxwVlU3gF6eR+a+q5nxdjf9vaJub25321u1DatLwr3oBkd XITXJhhzxk7beazzCqT1SrUFjNWvzEYx3zpVsesRxXvMPwZq4Yrw6SpeF7rE10NTZT0b ZjpWDnsyAJ6hVmyfciHt1ltfkT68f/6FLT6zk2rtzQG2VdJjP4j0Muhq2v5NtMP1cSoo FnyOqJ0nA8dKcF2T0IAINHdrCbE293FPEg40pT3iprrwDzCDPNAhjwqhAxn3gdHicGSt pVx7rdExIr9Mn6ID9o3YveGNIEWdsfowILlNVxubALOpB8xh2LUN1YdA59UBd4A2HG1G uxsw== X-Gm-Message-State: AO0yUKWykIhp3siInthufUqVQhBb/Lno6RWvICfHN6fwc6v8WAY403lm 966UTJHr6T6cpKBgv5MQ1xkPby3ImjTBl+twYkMIZ94eY+65F3MNDEgvC3zQLTNRdybksEpK0/f KXpnZNiJQaPccP0KnqU1H9w== X-Received: by 2002:a05:622a:1789:b0:3b3:b92f:3650 with SMTP id s9-20020a05622a178900b003b3b92f3650mr25781920qtk.62.1675525566662; Sat, 04 Feb 2023 07:46:06 -0800 (PST) X-Google-Smtp-Source: AK7set+wpZaF1531gI8PlaTdRTNDFmO335FHpG8XQH3Ub0+3zroPt0Zv4b+2DnF8VrjeJ7rN2qn+WA== X-Received: by 2002:a05:622a:1789:b0:3b3:b92f:3650 with SMTP id s9-20020a05622a178900b003b3b92f3650mr25781895qtk.62.1675525566365; Sat, 04 Feb 2023 07:46:06 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id d8-20020ac85348000000b003b835e7e283sm3673406qto.44.2023.02.04.07.46.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 07:46:06 -0800 (PST) From: Andrew Burgess To: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCHv2 1/6] gdb/remote: announce thread exit events for remote targets In-Reply-To: <0f056cdb-aa9c-111a-ed6a-4ac42cd2e1b7@palves.net> References: <0f056cdb-aa9c-111a-ed6a-4ac42cd2e1b7@palves.net> Date: Sat, 04 Feb 2023 15:46:04 +0000 Message-ID: <875ychqvr7.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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: Pedro Alves writes: > 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 > OK. I guess I'll try to move this series forward without this patch for now, and wait for your work to land, hopefully we can get your series in soon. Thanks, Andrew > 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); >> } >>