From: "Simon Marchi (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Tom Tromey <tromey@sourceware.org>, gdb-patches@sourceware.org
Subject: [review] Move type_byte_order earlier
Date: Wed, 27 Nov 2019 22:05:00 -0000 [thread overview]
Message-ID: <20191127220533.B092520AF6@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1574880479000.I4666431ecbb32ec98918f39f72d22c86b2bc8dde@gnutoolchain-gerrit.osci.io>
Simon Marchi has posted comments on this change.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/728
......................................................................
Patch Set 1:
(2 comments)
| --- gdb/gdbtypes.c
| +++ gdb/gdbtypes.c
| @@ -3344,12 +3344,30 @@ is_unique_ancestor (struct type *base, struct value *val)
| int offset = -1;
|
| return is_unique_ancestor_worker (base, value_type (val), &offset,
| value_contents_for_printing (val),
| value_embedded_offset (val),
| value_address (val), val) == 1;
| }
|
| +/* See gdbtypes.h. */
| +enum bfd_endian
PS1, Line 3353:
Might as well add a newline between the comment and the return type.
| +type_byte_order (const struct type *type)
| +{
| + bfd_endian byteorder = gdbarch_byte_order (get_type_arch (type));
| + if (TYPE_ENDIANITY_NOT_DEFAULT (type))
| + {
| + if (byteorder == BFD_ENDIAN_BIG)
| + return BFD_ENDIAN_LITTLE;
| + else if (byteorder == BFD_ENDIAN_LITTLE)
| + return BFD_ENDIAN_BIG;
| + else
| + return BFD_ENDIAN_UNKNOWN;
PS1, Line 3364:
Also not related to this patch, but is there really a legitimate case
for this else (byteorder being not _BIG and not _LITTLE)? Sounds to
me like this should be an assert.
| + }
| +
| + return byteorder;
| +}
| +
| \f
| /* Overload resolution. */
|
| /* Return the sum of the rank of A with the rank of B. */
--
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I4666431ecbb32ec98918f39f72d22c86b2bc8dde
Gerrit-Change-Number: 728
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-CC: Simon Marchi <simon.marchi@polymtl.ca>
Gerrit-Comment-Date: Wed, 27 Nov 2019 22:05:33 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
next prev parent reply other threads:[~2019-11-27 22:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-27 18:48 Tom Tromey (Code Review)
2019-11-27 22:05 ` Simon Marchi (Code Review) [this message]
2019-12-04 14:36 ` [review v2] " Tom Tromey (Code Review)
2019-12-04 15:32 ` Simon Marchi (Code Review)
2019-12-04 16:41 ` [pushed] " Sourceware to Gerrit sync (Code Review)
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=20191127220533.B092520AF6@gnutoolchain-gerrit.osci.io \
--to=gerrit@gnutoolchain-gerrit.osci.io \
--cc=gdb-patches@sourceware.org \
--cc=gnutoolchain-gerrit@osci.io \
--cc=tromey@sourceware.org \
/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).