[gdb] Fix gdb.dwarf2/varval.exp with -fPIE/-pie
authorTom de Vries <tdevries@suse.de>
Fri, 9 Aug 2019 04:49:04 +0000 (06:49 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 9 Aug 2019 04:49:04 +0000 (06:49 +0200)
commiteba4caf23152a1a66d10ce37c502ec78654cd5eb
treece04049ed9ed4644954febfadbe51e800db27dde
parent378646f7a4260eecd244ba840ae1af4e663e30a5
[gdb] Fix gdb.dwarf2/varval.exp with -fPIE/-pie

With target board unix/-fPIE/-pie, we get:
...
FAIL: gdb.dwarf2/varval.exp: print varval2
...

This is due comparing a get_frame_pc result (which includes the for PIE
non-zero relocation offset) with pc_high and pc_low obtained using
get_scope_pc_bounds (which do not include the relocation offset).

Fix this by adjusting pc_high and pc_low with the relocation offset.

Tested on x86_64-linux with target board unix/-fPIE/-pie.

gdb/ChangeLog:

2019-08-09  Tom de Vries  <tdevries@suse.de>

PR gdb/24591
* dwarf2read.c (dwarf2_fetch_die_loc_sect_off): Adjust pc_high and
pc_low with relocation offset.
gdb/ChangeLog
gdb/dwarf2read.c