diff options
author | Tom Tromey <tromey@adacore.com> | 2022-04-14 09:36:09 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2022-04-14 12:22:07 -0600 |
commit | 1a7c41d5ece7d0d1aa77d8019ee46f03181854fa (patch) | |
tree | 3fb5ec6ef8a926426c5ce78bd3b5768540244343 /gdb/testsuite/gdb.dwarf2 | |
parent | 8bbdbd6985d8d7615bab69f97f07e8bb78fb98f8 (diff) | |
download | gdb-1a7c41d5ece7d0d1aa77d8019ee46f03181854fa.zip gdb-1a7c41d5ece7d0d1aa77d8019ee46f03181854fa.tar.gz gdb-1a7c41d5ece7d0d1aa77d8019ee46f03181854fa.tar.bz2 |
Ignore 0,0 entries in .debug_aranges
When running the internal AdaCore test suite against the new DWARF
indexer, I found one regression on RISC-V. The test in question uses
--gc-sections, and winds up with an entry in the middle of a
.debug_aranges that has both address and length of 0. In this
scenario, gdb assumes the entries are terminated and then proceeds to
reject the section because it reads a subsequent entry as if it were a
header.
It seems to me that, because each header describes the size of each
.debug_aranges CU, it's better to simply ignore 0,0 entries and simply
read to the end. That is what this patch does.
I've patched an existing test to provide a regression test for this.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2')
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp index 67e96fb..adb4e0a 100644 --- a/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp +++ b/gdb/testsuite/gdb.dwarf2/locexpr-data-member-location.exp @@ -296,6 +296,9 @@ Dwarf::assemble ${asm_file} { } aranges {} cu_label { + # This 0,0 entry tests that the .debug_aranges reader can + # handle an apparent terminator before the end of the ranges. + arange {} 0 0 arange {} $foo_start $foo_end arange {} $bar_start $bar_end } |