]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Handle base type without DW_AT_byte_size
authorTom Tromey <tromey@adacore.com>
Fri, 25 Apr 2025 14:13:36 +0000 (08:13 -0600)
committerTom Tromey <tromey@adacore.com>
Tue, 29 Apr 2025 17:34:49 +0000 (11:34 -0600)
commit48d0ac705c45cb588a8e6d19ee911bc225c897cf
tree2916bf012082517567d779b19488042893825a91
parenta7175864d96765b291276cf3a6508b78ad3a9b23
Handle base type without DW_AT_byte_size

DWARF says that a base type can have DW_AT_bit_size, without
DW_AT_byte_size.  However, gdb does not correctly handle this; in
fact, it crashes, as pointed out in this LLVM merge request:

    https://github.com/llvm/llvm-project/pull/137123

This patch reworks the base type size logic a bit to handle this
situation.

Tested-by: Kevin Buettner <kevinb@redhat.com>
Approved-by: Kevin Buettner <kevinb@redhat.com>
gdb/dwarf2/read.c
gdb/testsuite/gdb.dwarf2/intbits.c
gdb/testsuite/gdb.dwarf2/intbits.exp