From: Tom Tromey Date: Wed, 19 Mar 2025 13:22:27 +0000 (-0600) Subject: Use attribute::unsigned_constant for DW_AT_bit_stride X-Git-Tag: binutils-2_45~794 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=898477d819f4917609cfacb1ab1a2ee550b53a78;p=thirdparty%2Fbinutils-gdb.git Use attribute::unsigned_constant for DW_AT_bit_stride DW_AT_bit_stride uses an unsigned constant, so make this explicit in the reader. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32680 --- diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 5751e762590..e29fef0f72a 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -12064,7 +12064,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) attr = dwarf2_attr (die, DW_AT_bit_stride, cu); if (attr != NULL) - bit_stride = attr->constant_value (0); + bit_stride = attr->unsigned_constant ().value_or (0); /* Irix 6.2 native cc creates array types without children for arrays with unspecified length. */