From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GBACDUICqWFaUwAAWB0awg (envelope-from ) for ; Thu, 02 Dec 2021 12:28:34 -0500 Received: by simark.ca (Postfix, from userid 112) id 3349F1F0CE; Thu, 2 Dec 2021 12:28:34 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_DYNAMIC autolearn=unavailable autolearn_force=no version=3.4.2 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 B33581EDEE for ; Thu, 2 Dec 2021 12:28:33 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5ED80385E00B for ; Thu, 2 Dec 2021 17:28:33 +0000 (GMT) Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id 65163385DC2D for ; Thu, 2 Dec 2021 17:20:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 65163385DC2D 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 8D46D7AE0B; Thu, 2 Dec 2021 17:20:46 +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 4J4jQk2p0Wz4rg4; Thu, 2 Dec 2021 17:20:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from [10.0.1.4] (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id EACA62DC60; Thu, 2 Dec 2021 17:20:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <0e6f88af-fc2a-799e-43cd-0e58912bf31d@FreeBSD.org> Date: Thu, 2 Dec 2021 09:20:44 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH 2/2] gdb: change store_waitstatus to return a target_waitstatus by value Content-Language: en-US To: Simon Marchi , gdb-patches@sourceware.org References: <20211202014002.796783-1-simon.marchi@polymtl.ca> <20211202014002.796783-2-simon.marchi@polymtl.ca> From: John Baldwin In-Reply-To: <20211202014002.796783-2-simon.marchi@polymtl.ca> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638465646; 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=VkBomt0WwCNOvj6lg4Xuk7/C+z/I47aQE1dQbBy/qZU=; b=iYqCozCuAoLXZLYwHVvFyl5iMlcm/Jbf6PiRFMZdlqFbCeGFBkSQs0X0irE2dJcMIuBmE2 KXwfK/HsewwWCJoxq5t0ub1Yx4FhCY46dyb9Vp7JiiiqUZQzxgrJX+9zbvGBDGTQ1zCIkC qHKb3ji+5FkE4yNhlMQjoVVajHhFUtqpNMJv+Wmn1DEGVSaGwbO48aRRoIZt7IHW0Ndk+s tTpPY21S3Y4oTQMSZxicJLKZulHrJlphRr7o7SptjQIJP2xhgzSwkwHSfoYbiDDBTfdGPm yF8erGaIl1lTuBAe4RVx/qc7t/KCLntef1WIPfUQ0IMvE6/vAErIzld0X57gPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638465646; a=rsa-sha256; cv=none; b=Pb4hNrDeFycRDGH9UaXFzYS2kGAUw+3bXUBnnYZMwn5v2hCu8cZv1rI50oVjfVuK61XiY4 2zrAEFbNvnpD+wn6mUza4gdBpIqioNnQnmydwOkHr/vMlscUkbx+ShTl0GTxjoDd3SmLgY 94y+QWL+Drf2IYvwxCcPNEUlY7c6nK0IufVA+lZFVIktpEUPDTsAPWuG7LBgAG2rr83bq0 01yU8dew1s6E75zkiwd4dl5AW5qtw1TdlgUlJK9PlTnROamtXfEkPFH2H2//EGgSOQlxuv AL6ZZtmsSnHz/S7iuLe6ADaqNy3B6hvf+AICtQz0szHES2I1nME5Ar2mZyEm/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 12/1/21 5:40 PM, Simon Marchi via Gdb-patches wrote: > store_waitstatus is basically a translation function between a status > integer and an equivalent target_waitstatus object. It would make sense > for it to take the integer as a parameter and return the > target_waitstatus by value. Do that, and rename to > host_status_to_waitstatus. Users can then do: > > ws = host_status_to_waitstatus (status) > > which does the right thing, given the move constructor of > target_waitstatus. > > Change-Id: I7a07d59d3dc19d3ed66929642f82f44f3e85d61b > --- > gdb/gnu-nat.c | 2 +- > gdb/inf-child.c | 17 +++++++++-------- > gdb/inf-child.h | 5 ++--- > gdb/inf-ptrace.c | 3 ++- > gdb/linux-nat.c | 6 +++--- > gdb/netbsd-nat.c | 2 +- > gdb/procfs.c | 2 +- > gdb/rs6000-aix-nat.c | 2 +- > 8 files changed, 20 insertions(+), 19 deletions(-) > > diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c > index 13127cd82461..f24e1c523c6b 100644 > --- a/gdb/gnu-nat.c > +++ b/gdb/gnu-nat.c > @@ -1821,7 +1821,7 @@ S_proc_wait_reply (mach_port_t reply, kern_return_t err, > } > else if (pid == inf->pid) > { > - store_waitstatus (&inf->wait.status, status); > + inf->wait.status = host_address_to_string (status); Typo? (host_address_to_string vs host_address_to_waitstatus) These two patches look good to me otherwise. -- John Baldwin