diff options
author | Tom Tromey <tromey@adacore.com> | 2025-03-19 14:02:12 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2025-04-24 13:25:08 -0600 |
commit | 6967933c5acf85a6c8d7322b1aff529ce86507e4 (patch) | |
tree | 1fd9b8ac4590ae94e2a0a26de20b80206fd4967a | |
parent | dbcdce70ea0d5f8fa4bb5587c892ecaba0fbc3c1 (diff) | |
download | binutils-6967933c5acf85a6c8d7322b1aff529ce86507e4.zip binutils-6967933c5acf85a6c8d7322b1aff529ce86507e4.tar.gz binutils-6967933c5acf85a6c8d7322b1aff529ce86507e4.tar.bz2 |
Use attribute::unsigned_constant for DW_AT_data_member_location
This changes the DWARF reader to use attribute::unsigned_constant for
DW_AT_data_member_location.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32680
-rw-r--r-- | gdb/dwarf2/read.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 4a142fe..aae74e9 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -9923,7 +9923,7 @@ handle_member_location (struct die_info *die, struct dwarf2_cu *cu, so if we see it, we can assume that a constant form is really a constant and not a section offset. */ if (attr->form_is_constant ()) - *offset = attr->constant_value (0); + *offset = attr->unsigned_constant ().value_or (0); else if (attr->form_is_section_offset ()) dwarf2_complex_location_expr_complaint (); else if (attr->form_is_block () @@ -9963,7 +9963,7 @@ handle_member_location (struct die_info *die, struct dwarf2_cu *cu, { if (attr->form_is_constant ()) { - LONGEST offset = attr->constant_value (0); + LONGEST offset = attr->unsigned_constant ().value_or (0); /* Work around this GCC 11 bug, where it would erroneously use -1 data member locations, instead of 0: @@ -12288,7 +12288,7 @@ mark_common_block_symbol_computed (struct symbol *sym, if (member_loc->form_is_constant ()) { - offset = member_loc->constant_value (0); + offset = member_loc->unsigned_constant ().value_or (0); baton->size += 1 /* DW_OP_addr */ + cu->header.addr_size; } else |