Handle DW_AT_ranges when reading partial symtabs
authorTom Tromey <tromey@adacore.com>
Wed, 27 Mar 2019 19:21:24 +0000 (13:21 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 1 Apr 2019 16:36:58 +0000 (10:36 -0600)
commit05caa1d236440cd8967f8804be8dbcf27fb490b6
treebe5a159d7aa6d8d434c51aac2951495455e55ffc
parent9d1447e09d4aa673826039321163b5a684e8e043
Handle DW_AT_ranges when reading partial symtabs

add_partial_subprogram does not handle DW_AT_ranges, while the full
symtab reader does.  This can lead to discrepancies where a function
is not put into a partial symtab, and so is not available to "break"
and the like -- but is available if the full symtab has somehow been
read.

This patch fixes the bug by arranging to read DW_AT_ranges when
reading partial DIEs.

This is PR symtab/23331.

The new test case is derived from dw2-ranges-func.exp, which is why I
kept the copyright dates.

gdb/ChangeLog
2019-04-01  Tom Tromey  <tromey@adacore.com>

PR symtab/23331:
* dwarf2read.c (partial_die_info::read): Handle DW_AT_ranges.

gdb/testsuite/ChangeLog
2019-04-01  Tom Tromey  <tromey@adacore.com>

PR symtab/23331:
* gdb.dwarf2/dw2-ranges-main.c: New file.
* gdb.dwarf2/dw2-ranges-psym.c: New file.
* gdb.dwarf2/dw2-ranges-psym.exp: New file.
gdb/ChangeLog
gdb/dwarf2read.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/dw2-ranges-main.c [new file with mode: 0644]
gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.c [new file with mode: 0644]
gdb/testsuite/gdb.dwarf2/dw2-ranges-psym.exp [new file with mode: 0644]
This page took 0.030174 seconds and 4 git commands to generate.