Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Kevin Buettner <kevinb@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix amd64->i386 linux syscall restart problem
Date: Wed, 10 Apr 2019 11:42:00 -0000	[thread overview]
Message-ID: <bc353e59-f640-2d09-8a71-984f0102733e@redhat.com> (raw)
In-Reply-To: <20190409192916.79fcb539@f29-4.lan>

On 4/10/19 3:29 AM, Kevin Buettner wrote:
> On Tue, 9 Apr 2019 18:46:45 +0100
> Pedro Alves <palves@redhat.com> wrote:
> 
>>> +	  void *ptr = (gdb_byte *) gregs 
>>> +		    + amd64_linux_gregset32_reg_offset[I386_EAX_REGNUM];  
>>
>> Need to wrap the expression that spawns two lines in ()s.
> 
> I've made this change.  And the other one too.
> 
>>> +
>>> +  /* Sign extend EAX value to avoid potential syscall restart problems.  */  
>>
>> I'd rather see both implementations use the same comment.  Could you
>> merge them?
> 
> I started to merge them and then decided to write a more detailed
> comment based on the text that I wrote for the commit comment.  I
> have, for the moment anyway, copied the comment to both locations with
> only slight changes which reflect where the comment is located.  The
> problem with having copies of the same long comment in two or more
> places is making sure that if one gets updated, then the rest do too. 
> It might be better to have one refer to the other.
> 
> I'm thinking that it might be preferable to have something like this
> in gdb/gdbserver/linux-x86-low.c:
> 
>   /* Sign extend EAX value to avoid potential syscall restart problems.
>   
>      See amd64_linux_collect_native_gregset() in gdb/amd64-linux-nat.c
>      for a detailed explanation.  */

I'm OK with that.  My concern with different comments in two places
is that at some point, like we managed to merge the x86
watchpoints code from gdb and gdbserver under gdb/nat/, we might be
able to merge this code as well.  And different comments make the job
a bit harder for the person doing that, since the person _then_ has to
decide what the resulting comment will be like.  If we can do it now,
it's preferable.  A pointer from one end to the other, like you're
proposing, works for me too.

> Below is a diff showing the new comments.  It also includes the
> changes which wrap the multi-line expressions in parens.

Thanks, that new version of the comment looks great.

Pedro Alves


  reply	other threads:[~2019-04-10 11:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-17  5:13 Kevin Buettner
2019-04-04 16:51 ` Kevin Buettner
2019-04-09 17:46 ` Pedro Alves
2019-04-10  2:29   ` Kevin Buettner
2019-04-10 11:42     ` Pedro Alves [this message]
2019-04-11  0:16       ` Kevin Buettner
2019-05-21 12:59         ` Tom de Vries
2019-06-21  6:34           ` [PING][PATCH] " Tom de Vries
2019-07-08 17:00             ` Kevin Buettner
2019-07-12 11:42               ` Tom de Vries
2019-07-12 12:24                 ` Kevin Buettner

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=bc353e59-f640-2d09-8a71-984f0102733e@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    /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