From 898477d819f4917609cfacb1ab1a2ee550b53a78 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 19 Mar 2025 07:22:27 -0600 Subject: [PATCH] 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 --- gdb/dwarf2/read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. */ -- 2.47.3