From patchwork Mon Nov 28 11:25:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 61146 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF27C38532D8 for ; Mon, 28 Nov 2022 11:26:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF27C38532D8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1669634771; bh=hyKpFXOcE3toZObp9LxpSeToVua9OmUE2gMNb6lPSBw=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=PBtZVXUDkDvOqt+/SCQQs938lkbOOlDu0eHJ8X1mzV8iedCVWvahCgHWDmpLUBwB1 OKsX6pngb7ZGFx2q+jAycs5lUsuX0XcuTg3Qe9B9KnEv1DGKIMgDKx1pDA5J3xS2H0 QTJ+cHxu8hG2lzLIG9zNhnkd6lFLZtM7gxb1h3RI= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 EA7463858CDB for ; Mon, 28 Nov 2022 11:25:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EA7463858CDB Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-427-WY7HEQ9FMQeRYXwB_6bJ9g-1; Mon, 28 Nov 2022 06:25:44 -0500 X-MC-Unique: WY7HEQ9FMQeRYXwB_6bJ9g-1 Received: by mail-wr1-f69.google.com with SMTP id k1-20020adfb341000000b0024215e0f486so549969wrd.21 for ; Mon, 28 Nov 2022 03:25:44 -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=hyKpFXOcE3toZObp9LxpSeToVua9OmUE2gMNb6lPSBw=; b=ISgeSTQ6rYkZxh6nU8YnH1BiyXSDwq9AWifYFaOmtE3JyfxWz+z2OjlFSsY6AQ2DCh cjBdYmBnMT8jHWm6JmvUiXqJPkTv1gKHXDI4QoShqmLYx9tfpf5O3zzZoSW+/3pmzbYZ 3V7ga5UMmpMqWcMMzK9nA0ZfVHTHjBtUmu0gZJH+adke9KlFAGSMLtg+BX6u09+VpcNT OJFFLjnV+n7b4bmZGTKshlC4typ2U9ZJEVLRasnJID6ETJSgageIyWD1Y9x6bdkdiZPV 6LWTTEfyG+u1xpzj2WDS+TT3eO+qEPsWRCNx1LE8EA9p1rMcoZ31SU8N356MCv76gaGU gDJw== X-Gm-Message-State: ANoB5pk8DB1mzau4U4iDLupbWstRzKfTdiGldADMMYXjDhc0g5XIiuus jH9I3jkyfSGzxhB7rhjq+jnvm7/V2BkXUsF7vibMpec8RuNkPsUnQG0c6GcLlTlii5AYYfRJTHE u2yDki0hLct0upfkAUAbCygjxAicaXLWTxXpnnCfD7nGYlKzWzrLyCXpVerd4g30kZMHqqGmHqA == X-Received: by 2002:a05:600c:5408:b0:3d0:1c3f:e3ae with SMTP id he8-20020a05600c540800b003d01c3fe3aemr27943408wmb.27.1669634743105; Mon, 28 Nov 2022 03:25:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf4AA1Q2vS47397sBJJccwIFS1SpIsCnvEMagpTeh1m3j1ihTzOpGmX9Amb7oq+aE5mTeWM5Rw== X-Received: by 2002:a05:600c:5408:b0:3d0:1c3f:e3ae with SMTP id he8-20020a05600c540800b003d01c3fe3aemr27943386wmb.27.1669634742838; Mon, 28 Nov 2022 03:25:42 -0800 (PST) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id p7-20020adfe607000000b00241fea203b6sm10660525wrm.87.2022.11.28.03.25.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Nov 2022 03:25:42 -0800 (PST) To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 1/6] gdb/remote: announce thread exit events for remote targets Date: Mon, 28 Nov 2022 11:25:33 +0000 Message-Id: <0215c520c680334efac7f0544d834ec1fb7aff8e.1669634536.git.aburgess@redhat.com> 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 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Burgess via Gdb-patches From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" 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 5118ecd0a31..1737caa579c 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -3978,6 +3978,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); }