From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 2F8A23858C33 for ; Tue, 9 May 2023 19:01:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2F8A23858C33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [172.16.0.192] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id CD34E1E0D4; Tue, 9 May 2023 15:01:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1683658873; bh=4WlTTrcRXag0JnJQf2zHWWQ5Chems2P/mr3Sw+IN7oI=; h=Date:Subject:To:References:From:In-Reply-To:From; b=SeyAHEFd8uZPlUJApI3hic9BAAvSICW3zZ0Jv6hLw2ZRZ4v4H0BekIW2+OjTSrS3s 2avi1toqPJm97oKBbKHd12TsrAJZFdhAdbVHh7OKy1RjjOj9bWVgbG56qU96CGwSSo DFD7fxA6NJYAT0emttC/5rAzf0cbvF7O/C416GQo= Message-ID: <10ba4b3e-19e0-2889-47de-67667db21af1@simark.ca> Date: Tue, 9 May 2023 15:01:13 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v3] gdb tests: Allow for "LWP" in thread IDs from info threads. Content-Language: fr To: John Baldwin , gdb-patches@sourceware.org References: <20230418201305.61272-1-jhb@FreeBSD.org> From: Simon Marchi In-Reply-To: <20230418201305.61272-1-jhb@FreeBSD.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 4/18/23 16:13, John Baldwin wrote: > Several tests assume that the first word after a thread ID in 'info > threads' output is "Thread". However, several targets use "LWP" > instead such as the FreeBSD and NetBSD native targets. The Linux > native target also uses "LWP" if libthread_db is not being used. > > Add a tdlabel_re global variable as a regular-expression for a thread > label in `info threads' that matches either "thread" or "LWP". > > Some other tests in the tree don't require a specific word, and > some targets may use other first words (e.g. OpenBSD uses "thread" > and Ravenscar threads use "Ravenscar Thread"). That LGTM, I don't really see another way: Approved-By: Simon Marchi One nit is that I prefer to use the ${::tdlabel_re} notation instead of the global keyword, but it's not a dealbreaker. And just one question: > diff --git a/gdb/testsuite/gdb.trace/report.exp b/gdb/testsuite/gdb.trace/report.exp > index 14db2511d40..a5b7ccf4ba5 100644 > --- a/gdb/testsuite/gdb.trace/report.exp > +++ b/gdb/testsuite/gdb.trace/report.exp > @@ -380,7 +380,7 @@ proc use_collected_data { data_source } { > > # There is always a thread of an inferior, either a live one or > # a faked one. > - gdb_test "info threads" "\\* ${decimal} (process|Thread) \[0-9\.\]+\[ \t\].*" > + gdb_test "info threads" "\\* ${decimal} ${tdlabel_re} \[0-9\.\]+\[ \t\].*" This one said "process" as well, I guess it's not important? Simon