gdb/testsuite: fix fission support in the Dwarf assembler
authorAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 26 Mar 2021 12:06:37 +0000 (12:06 +0000)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Wed, 7 Apr 2021 10:41:49 +0000 (11:41 +0100)
commit61dee7220ecff488f24d32511c2532466d25741f
treeaa226d6676b535a4dfbcaa8bbbf652523426a93e
parent1fd999d9093a7eca5d87420c6759c5fd1d3ddeb5
gdb/testsuite: fix fission support in the Dwarf assembler

This commit fixes fission support in the Dwarf assembler. I added the
new test gdb.dwarf2/fission-absolute-dwo.exp which is a simple example
of using the fission support.  I also rewrote the existing test
gdb.dwarf2/fission-multi-cu.exp to use the new functionality (instead
of using an x86-64 only assembler file).

To better support compiling the assembler files produced by the Dwarf
assembler I have added the new proc build_executable_and_dwo_files in
lib/dwarf.exp, this replaces build_executable_from_fission_assembler,
all the tests that used the old proc have been updated.  Where the old
proc assumed a single .S source file which contained the entire test,
the new proc allows for multiple source files.

The Dwarf assembler already had some fission support, however, this
was not actually used in any tests, and when I tried using it there
were a few issues.

The biggest change is that we now generate DW_FORM_GNU_addr_index
instead of DW_FORM_addr for the low and high pc in
_handle_macro_at_range, support for the DW_FORM_GNU_addr_index is new
in this commit.

gdb/testsuite/ChangeLog:

* gdb.dwarf2/fission-absolute-dwo.c: New file.
* gdb.dwarf2/fission-absolute-dwo.exp: New file.
* gdb.dwarf2/fission-base.exp: Use build_executable_and_dwo_files
instead of build_executable_from_fission_assembler.
* gdb.dwarf2/fission-loclists-pie.exp: Likewise.
* gdb.dwarf2/fission-loclists.exp: Likewise.
13 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.c [new file with mode: 0644]
gdb/testsuite/gdb.dwarf2/fission-absolute-dwo.exp [new file with mode: 0644]
gdb/testsuite/gdb.dwarf2/fission-base.exp
gdb/testsuite/gdb.dwarf2/fission-loclists-pie.exp
gdb/testsuite/gdb.dwarf2/fission-loclists.exp
gdb/testsuite/gdb.dwarf2/fission-multi-cu.S [deleted file]
gdb/testsuite/gdb.dwarf2/fission-multi-cu.c [new file with mode: 0644]
gdb/testsuite/gdb.dwarf2/fission-multi-cu.exp
gdb/testsuite/gdb.dwarf2/fission-multi-cu1.c [deleted file]
gdb/testsuite/gdb.dwarf2/fission-multi-cu2.c [deleted file]
gdb/testsuite/gdb.dwarf2/fission-reread.exp
gdb/testsuite/lib/dwarf.exp