diff options
author | Nick Clifton <nickc@redhat.com> | 2023-04-11 17:24:09 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2023-04-11 17:24:09 +0100 |
commit | 7bb9e56c6a69c99866d8827cda8fd7ace2298b47 (patch) | |
tree | b11fee3815c84d0da7b03ab7bbf2cc1ac4a06fe6 /binutils/dwarf.c | |
parent | 91496180eba5150fb169c5edaff16877eefae7f9 (diff) | |
download | gdb-7bb9e56c6a69c99866d8827cda8fd7ace2298b47.zip gdb-7bb9e56c6a69c99866d8827cda8fd7ace2298b47.tar.gz gdb-7bb9e56c6a69c99866d8827cda8fd7ace2298b47.tar.bz2 |
Replace an assertion in the dwarf code with a warning message.
PR 30327
* dwarf.c (read_and_display_attr_value): Warn if the number of views is greater than the number of locations.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r-- | binutils/dwarf.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c index f6ff238..87ce154 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -2927,8 +2927,14 @@ read_and_display_attr_value (unsigned long attribute, } else { - assert (debug_info_p->num_loc_views <= num); - num = debug_info_p->num_loc_views; + if (debug_info_p->num_loc_views > num) + { + warn (_("The number of views (%u) is greater than the number of locations (%u)\n"), + debug_info_p->num_loc_views, num); + debug_info_p->num_loc_views = num; + } + else + num = debug_info_p->num_loc_views; if (num > debug_info_p->num_loc_offsets) warn (_("More DW_AT_GNU_locview attributes than location offset attributes\n")); else |