binutils-gdb/gdb/dwarf2
Tom de Vries 9f6c202e57 [gdb/symtab] Handle DW_AT_ranges with DW_FORM_sec_off in partial DIE
While looking into a failure in gdb.go/package.exp with gcc-11, I noticed that
gdb shows some complaints when loading the executable (also with gcc-10, where
the test-case passes):
...
$ gdb -batch -iex "set complaints 100" package.10 -ex start
During symbol reading: Attribute value is not a constant (DW_FORM_sec_offset)
Temporary breakpoint 1 at 0x402ae6: file gdb.go/package1.go, line 8.
During symbol reading: Attribute value is not a constant (DW_FORM_sec_offset)
During symbol reading: Invalid .debug_rnglists data (no base address)
...

Fix this by using as_unsigned () to read DW_AT_ranges in the partial DIE
reader, similar to how that is done in dwarf2_get_pc_bounds.

Tested on x86_64-linux.

gdb/ChangeLog:

2021-01-25  Bernd Edlinger  <bernd.edlinger@hotmail.de>
	    Simon Marchi  <simon.marchi@polymtl.ca>
	    Tom de Vries  <tdevries@suse.de>

	* dwarf2/read.c (partial_die_info::read): Use as_unsigned () for
	DW_AT_ranges.

gdb/testsuite/ChangeLog:

2021-01-25  Tom de Vries  <tdevries@suse.de>

	* gdb.dwarf2/dw2-ranges-psym.exp (gdb_load_no_complaints): New proc.
	* lib/gdb.exp: Use gdb_load_no_complaints.
2021-01-25 16:32:31 +01:00
..
abbrev.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
abbrev.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
attribute.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
attribute.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
comp-unit.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
comp-unit.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
die.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
dwz.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
dwz.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
expr.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
expr.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
frame-tailcall.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
frame-tailcall.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
frame.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
frame.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
index-cache.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
index-cache.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
index-common.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
index-common.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
index-write.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
index-write.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
leb.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
leb.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
line-header.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
line-header.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
loc.c Use std::vector for "registers_used" in compile feature 2021-01-23 20:33:25 -07:00
loc.h Use std::vector for "registers_used" in compile feature 2021-01-23 20:33:25 -07:00
macro.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
macro.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
read.c [gdb/symtab] Handle DW_AT_ranges with DW_FORM_sec_off in partial DIE 2021-01-25 16:32:31 +01:00
read.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
section.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
section.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
stringify.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
stringify.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00