From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EFwnBTprsWQ8lyEAWB0awg (envelope-from ) for ; Fri, 14 Jul 2023 11:35:22 -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=dlJMnCan; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 0570F1E0BD; Fri, 14 Jul 2023 11:35:22 -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 RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9B18D1E00F for ; Fri, 14 Jul 2023 11:35:19 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9E4553858035 for ; Fri, 14 Jul 2023 15:35:18 +0000 (GMT) Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id ED22D3858281 for ; Fri, 14 Jul 2023 15:35:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ED22D3858281 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 [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 4R2bBv13PMz3H3b for ; Fri, 14 Jul 2023 15:35:03 +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 4R2bBt56rlz3Qnn for ; Fri, 14 Jul 2023 15:35:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689348902; 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=SN15GPT7R6kbvldZ45ubez6YvXOn+EPPpuGAlHQeEn4=; b=dlJMnCanuSTWovKaS2bNP0rzSls6VWbvXyOJ+xfjwzxyokpquaj01RiyonKyq3KewWPP0O 9uBfWAoVC6UGLhmmbMF8L3EFjW6pR6MG0FWunXfADJJ2FOx/Sci3QP1eSL6bwq/TY41fdW CE3wDef7OkaneOJBXSyx0FUNx3OOu+eUrMUU8U0Uec7rWqE+iV1uevJ8UYSF63TSjtQVs5 dQ9o0HYASHEAO9ju+ndT1VjHSGxyO2GE6Uqedjza3U9gHN4Jm03ZdOq1zSpawQuowYJ6PW U9p9GuF/rzo4sCxlFFQiCAp5ePyQD9jiCCH9Iee2hRDFkDDfrvsdND5B6YUtdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1689348902; 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=SN15GPT7R6kbvldZ45ubez6YvXOn+EPPpuGAlHQeEn4=; b=AhdIEv/kguguJ/Wi8IdfB+53gMuDROpXV2A8/nRQdKGWlGnOsbAJtCPBpy5KQrkjwJSQlP 6+qbwnllCTvCu4l91Iyxa5hAWDVKXJEW3h6552GVaS11UZnhfAjgUsGQN85NL4Hip/SM7t pdhG7DsZ9OMID1hH+TErUzTegQlFVJh575W/77QwdZ0+ZayT8lQ6yBbNo6/tz0PuZhiHrk PKo57U8UBdtQCBUaUCclVUuOweN61+6b/n/jBT2Wew7Q4cf3iwWoe/axEKxxpJIL/0D406 LJFZrd4AkkTBa1P9rOwRZdT+qe6d74k32dYSonlTcbNnc6+DWak1ObHCv1ohCQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1689348902; a=rsa-sha256; cv=none; b=AULlsQ4eK8elMRXDBsj2OJYkoQijzB9xzxF2kdf3UQ9f1MJkbeKiBMXzSHw8SZB2jIrJd3 9WSdvaj1VtD5NNxfgwXIo2h3GXQ6mZ0pQZ5lTnTA9P/e7ToaBUovlJSEZAdtonCi+Wel1b n0v7sbAkmTZwC2A2vTGjA1WgfTyE/mGJ9WZlOLg0XY7NJ9ZxCRZG1er5EZaOWKauDHvgP+ kwREllQdulvGRW8nlJjThZ+g3AFmvz7uKjSVySAv+7pG2SuoNkj3TCxODoefsAppL/vTD9 3Wh6K274RCvIQxZ8wlAw8vbwaJl+LON9elIFsoSTcCJ1dISGFQaGf8r2acTDbQ== Received: from [IPV6:2601:648:8680:16b0:98c9:a0d6:2ca0:57ef] (unknown [IPv6:2601:648:8680:16b0:98c9:a0d6:2ca0:57ef]) (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 4R2bBt2wr1zvD0 for ; Fri, 14 Jul 2023 15:35:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <872caa1c-920a-adf4-0738-cdad5251cc83@FreeBSD.org> Date: Fri, 14 Jul 2023 08:35:00 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PING] [PATCH v3] gdb tests: Allow for "LWP" in thread IDs from info threads. Content-Language: en-US From: John Baldwin 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> To: gdb-patches@sourceware.org In-Reply-To: <71f245cd-34c9-0179-bac5-3f2db5136f1f@FreeBSD.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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, NICE_REPLY_A, SPF_HELO_NONE, 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 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 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. >> > -- John Baldwin