[gdb/testsuite] Use $srcfile in DW_AT_name for CU
authorTom de Vries <tdevries@suse.de>
Fri, 23 Oct 2020 12:55:04 +0000 (14:55 +0200)
committerTom de Vries <tdevries@suse.de>
Fri, 23 Oct 2020 12:55:04 +0000 (14:55 +0200)
commit9476b583cb3e72e57355f5a6bfcd5ba69e71ea31
tree9874c8d4c6330dc9b78881baa90383704622d6a0
parent8747316ecf9ecf5aaf885b973b0c056fa4c3a2ee
[gdb/testsuite] Use $srcfile in DW_AT_name for CU

In dwarf assembly test-case ada-linkage-name.exp, we have:
...
standard_testfile .c -debug.S
  ...
  cu {} {
    DW_TAG_compile_unit {
      {DW_AT_name     ada-linkage-name.c}
...
Use $srcfile instead of ada-linkage-name.c.

In dwarf assembly test-case atomic-type.exp, we have:
...
standard_testfile .c -dw.S
  ...
  cu {} {
    DW_TAG_compile_unit {
      {DW_AT_name     atomic-type-dw.c}
...
The dwarf generated into atomic-type-dw.S is meant to represent the code in
atomic-type.c, not atomic-type-dw.c, so use $srcfile instead of
atomic-type-dw.c.

Fix these and similar.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-10-23  Tom de Vries  <tdevries@suse.de>

* gdb.dwarf2/ada-linkage-name.exp: Use $srcfile for DW_AT_name of CU.
* gdb.dwarf2/atomic-type.exp: Same.
* gdb.dwarf2/bad-regnum.exp: Same.
* gdb.dwarf2/cpp-linkage-name.exp: Same.
* gdb.dwarf2/dw2-align.exp: Same.
* gdb.dwarf2/dw2-bad-elf.exp: Same.
* gdb.dwarf2/dw2-bad-mips-linkage-name.exp: Same.
* gdb.dwarf2/dw2-bad-unresolved.exp: Same.
* gdb.dwarf2/dw2-namespaceless-anonymous.exp: Same.
* gdb.dwarf2/dw2-opt-structptr.exp: Same.
* gdb.dwarf2/dw2-unusual-field-names.exp: Same.
* gdb.dwarf2/enum-type.exp: Same.
* gdb.dwarf2/frame-inlined-in-outer-frame.exp: Same.
* gdb.dwarf2/info-locals-optimized-out.exp: Same.
* gdb.dwarf2/main-subprogram.exp: Same.
* gdb.dwarf2/missing-type-name.exp: Same.
* gdb.dwarf2/nonvar-access.exp: Same.
* gdb.dwarf2/typedef-void-finish.exp: Same.
* gdb.dwarf2/var-access.exp: Same.
* gdb.dwarf2/void-type.exp: Same.
21 files changed:
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp
gdb/testsuite/gdb.dwarf2/atomic-type.exp
gdb/testsuite/gdb.dwarf2/bad-regnum.exp
gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp
gdb/testsuite/gdb.dwarf2/dw2-align.exp
gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp
gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp
gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp
gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp
gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp
gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp
gdb/testsuite/gdb.dwarf2/enum-type.exp
gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp
gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp
gdb/testsuite/gdb.dwarf2/main-subprogram.exp
gdb/testsuite/gdb.dwarf2/missing-type-name.exp
gdb/testsuite/gdb.dwarf2/nonvar-access.exp
gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp
gdb/testsuite/gdb.dwarf2/var-access.exp
gdb/testsuite/gdb.dwarf2/void-type.exp