From: Pedro Alves <pedro@palves.net>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Cc: Matt Turner <mattst88@gmail.com>
Subject: Re: [PATCH] Linux: Avoid pread64/pwrite64 for high memory addresses (PR gdb/30525)
Date: Thu, 6 Jul 2023 14:43:36 +0100 [thread overview]
Message-ID: <f6c9002d-c897-5178-e9c6-514ef5b29b96@palves.net> (raw)
In-Reply-To: <87a5wakzo4.fsf@redhat.com>
Hi Andrew,
On 2023-07-05 18:59, Andrew Burgess wrote:
> Pedro Alves <pedro@palves.net> writes:
>> + if ((off_t) offset >= 0)
>> + {
>> + ret = (readbuf != nullptr
>> + ? pread64 (fd, readbuf, len, offset)
>> + : pwrite64 (fd, writebuf, len, offset));
>> + }
>
> I haven't tested this, but the change looks good to me with one nit...
>
> I think the '{' and '}' here (and in gdbserver below) aren't GDB style,
> as there's only a single statement?
I don't really mind much either way, as we're not super consistent, but note that
we do have a GDB-specific rule about this. Here:
https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards
It says:
"Any two or more lines in code should be wrapped in braces, even if they are comments, as they look like separate statements:"
As that says "Any two or more lines in code", I think it applies in this situation too.
Pedro Alves
next prev parent reply other threads:[~2023-07-06 13:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-05 13:41 Pedro Alves
2023-07-05 14:45 ` Matt Turner
2023-07-05 17:59 ` Andrew Burgess
2023-07-06 13:43 ` Pedro Alves [this message]
2023-07-06 13:54 ` Pedro Alves
2023-07-06 15:25 ` Tom Tromey
2023-07-06 16:47 ` Pedro Alves
2023-07-06 17:00 ` Pedro Alves
2023-07-07 15:18 ` Tom Tromey
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=f6c9002d-c897-5178-e9c6-514ef5b29b96@palves.net \
--to=pedro@palves.net \
--cc=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=mattst88@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).