From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qMuZKXezWmQZmQQAWB0awg (envelope-from ) for ; Tue, 09 May 2023 16:56:23 -0400 Received: by simark.ca (Postfix, from userid 112) id A69B11E11D; Tue, 9 May 2023 16:56:23 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (2048-bit key; secure) header.d=freebsd.org header.i=@freebsd.org header.a=rsa-sha256 header.s=dkim header.b=P2AChZio; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RDNS_DYNAMIC autolearn=unavailable autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3408A1E0D6 for ; Tue, 9 May 2023 16:56:23 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 985B33857024 for ; Tue, 9 May 2023 20:56:21 +0000 (GMT) Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id A0A633858C2B for ; Tue, 9 May 2023 20:56:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A0A633858C2B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4QG9Rq4m85z3NpJ; Tue, 9 May 2023 20:56:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QG9Rq3yXFz3Hp5; Tue, 9 May 2023 20:56:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683665767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3Pyab3bjtQJ7TSwNTfPk9t58+/ZNoDimvLhlnoCSEos=; b=P2AChZioCXQq6w5tHl8lLvuvtkqPIkV4rumDOjCANvEzihghKYUCyHF5rD5engOMDZP5UE BgXIx/fG5PVnKFCJSV3HllieO7YK/ojGR4CakaejOMSoMJg97udMRvNa7PetgaGOpboE/n RwYwbyYMTmelIGqxHtGi1W+nueW7HWnu45gkaYwG08D27pu7mMlt9HW1l93JWMh2Isj4kZ kqDyZcOoMP0f+wBvxv4fgQ/92cdoJSX5/9jpztsVE3OtI/nnBFSnC60vWHnVXe2vzFsSTt q4SApeVxTTVLuRFpf6f7QBAcyeFdF5lOggTQK5hVdJRfmVEhsc9GWTTdoLA4RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683665767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3Pyab3bjtQJ7TSwNTfPk9t58+/ZNoDimvLhlnoCSEos=; b=eZGE+q+8aZiUMqrriVwdjjwCR4KIQxmt2PeIw6fJpL7LX3t8n3RCD3Y7+nbjedOOkKMK2B qM4YgI4oOeQ0Ho7jncsxJATAaAxYcvFTmsJ3nz+ym9FO6X+DaF98Ojz+QvlYiR5rgK/PAX K7DWE21v76mPqqzPVspLic9YdVo3gFM42vRsQIg71utmqbIDfh/T4OYNimDcB5TPru0mXD /KS40FbPQEKfuV0KZatFRt/dLbmsPuV0Le1OoeQG18fiQ/L1b7826WBwDY+ZojmMFTKUqL 9C2AQ+m+0Ftp4UR4AW7NgMULTsGOtvGPsGIu8ahHhQfV4RY0u0NXJYpKmln4yQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683665767; a=rsa-sha256; cv=none; b=OFXtTKxdUpDaJOyvl4J1VS6j78KLt6rkU2U/6EuKlKN7ccr25YMfhkpRZ9FMWTHql/lguI HTUTHmSsAk48FAl9fDc44tqG27ddkj6nTuWkezOf+s7yvvAwzIDVtrtN8hwqNak82w2/Q/ UDiyVzaffAjIk8If2GTVuTPUqHjCPnayuc/v8dBSbDjiH+Fg/uVjlpv/dJcVV6zltcR6W6 hQ6iuIpSEEfkUyoD7s//hBvTVq6Ec44KxkR18YYaOGKC+GWsl+AEcL75xN7kFfX1GNnxIT 0TpBd01bKeDxamhI9pYGEWL3kUk57eBBYBMQFQ7ICycmmvK4wZ2pw889JABGnQ== Received: from [IPV6:2601:648:8680:16b0:699c:410f:3b64:a11f] (unknown [IPv6:2601:648:8680:16b0:699c:410f:3b64:a11f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4QG9Rq1168zSSs; Tue, 9 May 2023 20:56:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Tue, 9 May 2023 13:56:05 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Content-Language: en-US To: Simon Marchi , gdb-patches@sourceware.org References: <20230418201305.61272-1-jhb@FreeBSD.org> <10ba4b3e-19e0-2889-47de-67667db21af1@simark.ca> From: John Baldwin Subject: Re: [PATCH v3] gdb tests: Allow for "LWP" in thread IDs from info threads. In-Reply-To: <10ba4b3e-19e0-2889-47de-67667db21af1@simark.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 5/9/23 12:01 PM, Simon Marchi wrote: > 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? Hummm, it didn't regress on Linux, but on some other native target that doesn't support threads it might regress I guess. normal_pid_to_str uses "process " and is the defalt for target::pid_to_str. Probably tdlabel_re should permit "process" as a word as well: diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 527c84599ca..6ded65e31c4 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -283,7 +283,7 @@ set inferior_exited_re "(?:\\\[Inferior \[0-9\]+ \\(\[^\n\r\]*\\) exited)" # A regular expression that matches the first word of a thread # description after the thread number info 'info threads' -set tdlabel_re "(Thread|LWP)" +set tdlabel_re "(process|Thread|LWP)" # A regular expression that matches a value history number. # E.g., $1, $2, etc. (I'd also have to reword the commit log a bit to mention this case if so.) -- John Baldwin