Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: John Baldwin <jhb@FreeBSD.org>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] gdb: change store_waitstatus to return a target_waitstatus by value
Date: Thu, 2 Dec 2021 12:21:58 -0500	[thread overview]
Message-ID: <fc7b01f1-c5d7-efa4-0516-f95a9a14719b@polymtl.ca> (raw)
In-Reply-To: <0e6f88af-fc2a-799e-43cd-0e58912bf31d@FreeBSD.org>



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

  reply	other threads:[~2021-12-02 17:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-02  1:40 [PATCH 1/2] gdb: return *this in target_waitstatus setters Simon Marchi via Gdb-patches
2021-12-02  1:40 ` [PATCH 2/2] gdb: change store_waitstatus to return a target_waitstatus by value Simon Marchi via Gdb-patches
2021-12-02 17:20   ` John Baldwin
2021-12-02 17:21     ` Simon Marchi via Gdb-patches [this message]
2021-12-03 13:10 ` [PATCH 1/2] gdb: return *this in target_waitstatus setters Pedro Alves
2021-12-03 13:35   ` Simon Marchi via Gdb-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fc7b01f1-c5d7-efa4-0516-f95a9a14719b@polymtl.ca \
    --to=gdb-patches@sourceware.org \
    --cc=jhb@FreeBSD.org \
    --cc=simon.marchi@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox