diff options
author | Tom Tromey <tromey@adacore.com> | 2019-11-25 11:14:50 -0700 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2019-12-04 09:31:18 -0700 |
commit | 7ab4a236ce85f1e0950e88e267e679a066b77bed (patch) | |
tree | d59df6f09d15b5217ff986ff33a7019c34ba8081 | |
parent | 103a685e7fd27bb1347a2459c07e648aac7a6f54 (diff) | |
download | fsf-binutils-gdb-7ab4a236ce85f1e0950e88e267e679a066b77bed.zip fsf-binutils-gdb-7ab4a236ce85f1e0950e88e267e679a066b77bed.tar.gz fsf-binutils-gdb-7ab4a236ce85f1e0950e88e267e679a066b77bed.tar.bz2 |
Move type_byte_order earlier
I failed to notice that the scalar_storage_order patch put
type_byte_order at the end of gdbtypes.c. The end of the file is
normally where the file's _initialize function goes. This moves
type_byte_order earlier, into a more relevant section.
gdb/ChangeLog
2019-12-04 Tom Tromey <tromey@adacore.com>
* gdbtypes.c (type_byte_order): Move earlier. Assert for unknown
endian-ness.
Change-Id: I4666431ecbb32ec98918f39f72d22c86b2bc8dde
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbtypes.c | 38 |
2 files changed, 25 insertions, 18 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ffae608..af39621 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2019-12-04 Tom Tromey <tromey@adacore.com> + * gdbtypes.c (type_byte_order): Move earlier. Assert for unknown + endian-ness. + +2019-12-04 Tom Tromey <tromey@adacore.com> + * dwarf2read.c (dwarf2_init_float_type) (dwarf2_init_complex_target_type): Add byte_order parameter. (read_base_type): Compute byte order earlier. diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 0609634..737ebfe 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -3423,6 +3423,26 @@ is_unique_ancestor (struct type *base, struct value *val) value_address (val), val) == 1; } +/* See gdbtypes.h. */ + +enum bfd_endian +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 + { + gdb_assert (byteorder == BFD_ENDIAN_LITTLE); + return BFD_ENDIAN_BIG; + } + } + + return byteorder; +} + /* Overload resolution. */ @@ -5701,21 +5721,3 @@ _initialize_gdbtypes (void) show_strict_type_checking, &setchecklist, &showchecklist); } - -/* See gdbtypes.h. */ -enum bfd_endian -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; - } - - return byteorder; -} |