]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Handle DW_AT_endianity on enumeration types
authorTom Tromey <tromey@adacore.com>
Tue, 9 Jan 2024 18:47:17 +0000 (11:47 -0700)
committerTom Tromey <tromey@adacore.com>
Wed, 24 Jan 2024 14:45:04 +0000 (07:45 -0700)
commit7737b1336402cd4682538620ab996bdb7ad0ea79
treeecbc58cf71acd8ceb8cdd73d96a1eb218aae8af4
parent44acb01769b03fe9d06e953b21b8aed4e0f4261b
Handle DW_AT_endianity on enumeration types

A user found that gdb would not correctly print a field from an Ada
record using the scalar storage order feature.  We tracked this down
to a combination of problems.

First, GCC did not emit DW_AT_endianity on the enumeration type.
DWARF does not specify this, but it is an obvious and harmless
extension.  This was fixed in GCC recently:

    https://gcc.gnu.org/pipermail/gcc-patches/2024-January/642347.html
    https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=5d8b60effc7268448a94fbbbad923ab6871252cd

Second, GDB did not handle this attribute on enumeration types.  This
patch makes this change and adds a test case that will pass with the
patched GCC.

So far, the GCC patch isn't on the gcc-13 branch; but if it ever goes
in, the test case in this patch can be updated to reflect that.

Reviewed-By: Keith Seitz <keiths@redhat.com>
gdb/dwarf2/read.c
gdb/testsuite/gdb.ada/scalar_storage.exp
gdb/testsuite/gdb.ada/scalar_storage/storage.adb