[gdb/testsuite] Fix inter-cu refs in inlined_subroutine-inheritance.exp
authorTom de Vries <tdevries@suse.de>
Mon, 24 Jun 2019 10:20:39 +0000 (12:20 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 24 Jun 2019 10:20:39 +0000 (12:20 +0200)
commit385b97d3ac9c5c57a610d2e5b358ed888008ae31
tree5f1d70c6232e2ca08c13af19b46e1a05f5c021a5
parenta33f989b4ed69c9f8f905360444e3d57a83a0cb6
[gdb/testsuite] Fix inter-cu refs in inlined_subroutine-inheritance.exp

When running gdb.dwarf2/inlined_subroutine-inheritance.exp with board
cc-with-dwz, we run into:
...
dwz: inlined_subroutine-inheritance: Couldn't find DIE referenced by \
  DW_AT_abstract_origin
...

The problem is that the DW_AT_abstract_origin attributes refer to DIEs in
other CUs, while the references are encoded using the cu-relative encoding
DW_FORM_ref4.

Fix this by forcing the references to use DW_FORM_ref_addr.

Tested on x86_64-linux.

Tested with commit c24bdb023c "Introduce dwarf2_cu::get_builder" reverted,
and verified that the test-case fails in the same way before and after this
patch.

gdb/testsuite/ChangeLog:

2019-06-24  Tom de Vries  <tdevries@suse.de>

* gdb.dwarf2/inlined_subroutine-inheritance.exp:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/inlined_subroutine-inheritance.exp