From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id N3o8LL0CqWGMUwAAWB0awg (envelope-from ) for ; Thu, 02 Dec 2021 12:30:37 -0500 Received: by simark.ca (Postfix, from userid 112) id A2B491F0CE; Thu, 2 Dec 2021 12:30:37 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from 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 27A7F1EDEE for ; Thu, 2 Dec 2021 12:30:37 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 68559385DC02 for ; Thu, 2 Dec 2021 17:30:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68559385DC02 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1638466236; bh=pZXp3GWUUOcFOzjjtn/33w5DVC8OMyVVl4N7Hqk17VE=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=YOr3BNxmUMGP0UlEvy76rUVDr35+ANTv+f8ovFQoHpvDrFeV9/8qPN/i03Ck7aoTJ 4LXnBI994C3NNd1Ry3FmVrwTGvqYROM4z2FWzbxt89I0YqLbqva6XU7iaIJhwePi4U 9gZuPgHgwt/WRYPyfSZTM2tXx8+vwFoPls7Ok/Z0= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 5AED5385DC26 for ; Thu, 2 Dec 2021 17:22:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5AED5385DC26 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 1B2HLwC4003998 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 2 Dec 2021 12:22:03 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 1B2HLwC4003998 Received: from [10.0.0.11] (192-222-157-6.qc.cable.ebox.net [192.222.157.6]) (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 ABE701EDEE; Thu, 2 Dec 2021 12:21:58 -0500 (EST) Message-ID: Date: Thu, 2 Dec 2021 12:21:58 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; 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: John Baldwin , gdb-patches@sourceware.org References: <20211202014002.796783-1-simon.marchi@polymtl.ca> <20211202014002.796783-2-simon.marchi@polymtl.ca> <0e6f88af-fc2a-799e-43cd-0e58912bf31d@FreeBSD.org> In-Reply-To: <0e6f88af-fc2a-799e-43cd-0e58912bf31d@FreeBSD.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 2 Dec 2021 17:21:58 +0000 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: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-12-02 12:20, John Baldwin wrote: > 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. > Oops, the auto-complete played a trick on me. Will fix locally, thanks for taking a look. Simon