From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +J9iDSvx/WV6+BEAWB0awg (envelope-from ) for ; Fri, 22 Mar 2024 16:59:23 -0400 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=Lq1cN2UB; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 24E8C1E0C0; Fri, 22 Mar 2024 16:59:23 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id C5A171E08C for ; Fri, 22 Mar 2024 16:59:20 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 209633858415 for ; Fri, 22 Mar 2024 20:59:20 +0000 (GMT) Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by sourceware.org (Postfix) with ESMTPS id BE5053858D1E for ; Fri, 22 Mar 2024 20:58:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BE5053858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BE5053858D1E Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=96.47.72.81 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1711141140; cv=pass; b=KVeObiTMijofHY7LJx75woI5I203yxHCIP/OoMP73PQ0AK68UUIM6BWEjqoGSW6w9A911IzszCUeNGNjFPFTe91TPmFjgX3o2Y4l2xeQVcn1cwBRDegYZFiaeEE6IZvYEA6391KYsxxkoR6U0tC16Be0iuhr08RjMzmtL68eNkg= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1711141140; c=relaxed/simple; bh=AOz3pS/k+BoT0NckXZtNtmk9novz1xS+tLjCqAN8CKU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:From:To; b=Mgx0VYmmX2h2Yt77bHZ7sxJRM+YEtYhvAeeinvUKbmf1rNZnkjNQhxckI0WtRykkAX9c+/lHx/8nKti9ivTNeWiFvrWK/1BaSUZi4IJRJpEztzw7OSpiB6qHzgKIhbzv7IuvA0w8muboxQApkykI62RYtxiM+cAN+xOHQGgD5cU= ARC-Authentication-Results: i=2; server2.sourceware.org Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80]) (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 4V1ZSL0t0kz4bm0 for ; Fri, 22 Mar 2024 20:58:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 4V1ZSL07NWz4Frs for ; Fri, 22 Mar 2024 20:58:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711141138; 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=OLBlZuUi+ZEZrMH999Tdj21LGTYp95mXM4hJMqLddlU=; b=Lq1cN2UBPzPuTRcwq5vwWe4yh4JRU63iSV0Y0Z+Y6NCUYUhznoNA+n2rB6Q6Zrjbv2QTK3 vEfL5CzI2qBu3OUIhHKUnrrYvWPz1QWvRz3bbaYG2jtyjfcXzY02MTwk9FjcBSVWrggBYr n/jNxacoALAjja/kDAVyjgXhuRpkpzd6xVTPMMQa+gXzgQTIJ2FG5A8eg3NxuhLp5PcI7T tZ146VReAEpCntC0Ecoio6GY9+DxRRVuon76GsPeHr7O/kd9FquzOxNPCwNwuU8NX3Nqp7 RuNmsaFA/wl5pHA+gFC9LjDIrXvFHmNELn54Amx1nf3kPfzkNxoJhR0J+RMfdQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711141138; a=rsa-sha256; cv=none; b=GBcMdLX354Bm+DinviXQsPshOCV58ocu+doX9BEb2Lc1QYat05A5UXa/oFqwjOyJTCz9jW mEBUZGSJCxsyDLRrYwROHjNyM5LxoC0hNL988LcSEr3Xj822mzjD0IPCqqLZPszsY5Fa7z FC6iteQImQN3Fgg3Mt7DWGcnCqMhO2JO2Ozb7DJFxnddWQIK7ucqgsRxFc39YhsEpMGTwv 3QaAius9gCHMSLdPdlXMAS3r5bFwTpSvqE0obd/eqE9Kg/58nmbcfhxx0psZjteE0eN0n6 mqVwP2ASVTG614MCJuRzJ8rNk8D1PgH8WZmfzUNP8Wzr1CvYp21AUCVy1jIOnQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711141138; 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=OLBlZuUi+ZEZrMH999Tdj21LGTYp95mXM4hJMqLddlU=; b=WadPE8UsYXvQ8j2+CQjxFayVy3RY3hDNw7fEbt+8gHboXAhcTedfi+20OkqjeS/FmHI1F6 QeZFktNwcYAUj96EAg+KbzUOAn1XS5mE6WmdVn3HeSkhbnEuZxjES1hP0fxCASYx+Y7X1y E7TKGDlX++nYg1Qq90HYiZSFdOj0Omsy3Y8zhUg/AugK8J8J5xE1MuAcOWI2u7tePGSXw7 blEoyYIMaDTY1I7EqNqRIAC/l6+YJ3RZ6qeaPYCRsdPiHtEIEDrDdKUABodlIUdgjy/+HS l87ylqUURDYkwSMeLw7UblyJNPO4rLFXDBAeHFbGtU+7HTUakSV+8oUN0mIIHA== Received: from [IPV6:2601:644:937f:4c50:8511:5903:3902:6538] (unknown [IPv6:2601:644:937f:4c50:8511:5903:3902:6538]) (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 4V1ZSK5XSPz1cQM for ; Fri, 22 Mar 2024 20:58:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: Date: Fri, 22 Mar 2024 13:58:56 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PING] [PATCH v3] gdb tests: Allow for "LWP" in thread IDs from info threads. Content-Language: en-US From: John Baldwin To: gdb-patches@sourceware.org References: <20230418201305.61272-1-jhb@FreeBSD.org> <10ba4b3e-19e0-2889-47de-67667db21af1@simark.ca> <3458accc-ca2a-99aa-166e-6546c62ee9f8@FreeBSD.org> <71f245cd-34c9-0179-bac5-3f2db5136f1f@FreeBSD.org> <872caa1c-920a-adf4-0738-cdad5251cc83@FreeBSD.org> In-Reply-To: <872caa1c-920a-adf4-0738-cdad5251cc83@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 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 On 7/14/23 8:35 AM, John Baldwin wrote: > On 6/30/23 7:21 AM, John Baldwin wrote: >> On 6/9/23 9:56 AM, John Baldwin wrote: >>> On 5/26/23 10:51 AM, John Baldwin wrote: >>>> On 5/12/23 7:15 AM, John Baldwin wrote: >>>>> On 5/9/23 1:56 PM, John Baldwin wrote: >>>>>> 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.) >>>>> >>>>> Just to be sure, are you still ok with this patch with this tweak? >>>> >>>> Ping, here's the updated log message to match: >>>> >>>> gdb tests: Allow for "LWP" in thread IDs from info threads. >>>> >>>> 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. >>>> Targets that do not support threads use "process" as the first word >>>> via normal_pid_to_str. >>>> >>>> Add a tdlabel_re global variable as a regular-expression for a thread >>>> label in `info threads' that matches either "process", "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"). >>> >>> Ping, this is mostly a small change to a previously approved patch, just not >>> sure what the threshold is for if a fixup change is small enough to still >>> count as approved, etc. I retested this again this week and it fixed about 100 tests on FreeBSD/amd64 and had no regressions on Linux x86-64. Given the version without "process" was approved by Simon previously, I'm going to go ahead and push the version with the "process" change. -- John Baldwin