diff options
author | Tom de Vries <tdevries@suse.de> | 2020-10-23 14:55:04 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-10-23 14:55:04 +0200 |
commit | 9476b583cb3e72e57355f5a6bfcd5ba69e71ea31 (patch) | |
tree | 9874c8d4c6330dc9b78881baa90383704622d6a0 /gdb | |
parent | 8747316ecf9ecf5aaf885b973b0c056fa4c3a2ee (diff) | |
download | gdb-9476b583cb3e72e57355f5a6bfcd5ba69e71ea31.zip gdb-9476b583cb3e72e57355f5a6bfcd5ba69e71ea31.tar.gz gdb-9476b583cb3e72e57355f5a6bfcd5ba69e71ea31.tar.bz2 |
[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.
Diffstat (limited to 'gdb')
21 files changed, 72 insertions, 24 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f75c732..2683237 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,26 @@ +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. + 2020-10-22 Simon Marchi <simon.marchi@polymtl.ca> PR gdb/26693 diff --git a/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp b/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp index 0b440c8..870a755 100644 --- a/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp +++ b/gdb/testsuite/gdb.dwarf2/ada-linkage-name.exp @@ -34,7 +34,7 @@ Dwarf::assemble $asm_file { cu {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_Ada95} - {DW_AT_name ada-linkage-name.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { diff --git a/gdb/testsuite/gdb.dwarf2/atomic-type.exp b/gdb/testsuite/gdb.dwarf2/atomic-type.exp index d28af05..1058d2d 100644 --- a/gdb/testsuite/gdb.dwarf2/atomic-type.exp +++ b/gdb/testsuite/gdb.dwarf2/atomic-type.exp @@ -25,10 +25,12 @@ standard_testfile .c -dw.S set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { + global srcfile + cu {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C11} - {DW_AT_name atomic-type-dw.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels i_l c_l c_c_l ac_c_l pac_c_l vpac_c_l avpac_c_l diff --git a/gdb/testsuite/gdb.dwarf2/bad-regnum.exp b/gdb/testsuite/gdb.dwarf2/bad-regnum.exp index acd739f..600ec56 100644 --- a/gdb/testsuite/gdb.dwarf2/bad-regnum.exp +++ b/gdb/testsuite/gdb.dwarf2/bad-regnum.exp @@ -25,10 +25,12 @@ standard_testfile main.c -dw.S # Make some DWARF for the test. set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { + global srcfile + cu {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C} - {DW_AT_name bad-regnum-dw.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels integer_label diff --git a/gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp b/gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp index f2c88b9..a1077b5 100644 --- a/gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp +++ b/gdb/testsuite/gdb.dwarf2/cpp-linkage-name.exp @@ -30,10 +30,12 @@ standard_testfile .c -debug.S # Set up the DWARF for the test. set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { + global srcfile + cu {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C_plus_plus} - {DW_AT_name ada-linkage-name.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { diff --git a/gdb/testsuite/gdb.dwarf2/dw2-align.exp b/gdb/testsuite/gdb.dwarf2/dw2-align.exp index 640216a..4ad4fe8 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-align.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-align.exp @@ -30,7 +30,7 @@ Dwarf::assemble $asm_file { cu {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C_plus_plus} - {DW_AT_name dw2-align.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels itype ptype diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp index a85d343..e939046 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-elf.exp @@ -39,7 +39,7 @@ standard_testfile main.c -other.S -dwarf.S # Make some DWARF for the test. set asm_file [standard_output_file $srcfile3] Dwarf::assemble $asm_file { - global srcdir subdir srcfile + global srcdir subdir srcfile srcfile2 declare_labels ranges_label_1 ranges_label_2 L1 L2 @@ -52,7 +52,7 @@ Dwarf::assemble $asm_file { cu {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C} - {DW_AT_name dw2-bad-elf.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir ${srcdir}/${subdir}} {stmt_list $L1 DW_FORM_sec_offset} {ranges ${ranges_label_1} DW_FORM_sec_offset} @@ -80,7 +80,7 @@ Dwarf::assemble $asm_file { cu {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C} - {DW_AT_name dw2-bad-elf-other.c} + {DW_AT_name $srcfile2} {DW_AT_comp_dir ${srcdir}/${subdir}} {stmt_list $L2 DW_FORM_sec_offset} {ranges ${ranges_label_2} DW_FORM_sec_offset} diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp index 238297c..bfb9521 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-mips-linkage-name.exp @@ -26,10 +26,12 @@ standard_testfile .c .S set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { + global srcfile + cu {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C_plus_plus} - {DW_AT_name dw2-bad-mips-linkage-name.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp b/gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp index 44d5faa..e93f2ce 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-bad-unresolved.exp @@ -28,10 +28,12 @@ standard_testfile .c -2.S set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { + global srcfile + cu {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C} - {DW_AT_name dw2-bad-unresolved-2.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels b_l diff --git a/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp b/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp index a6d9a50..bba05e4 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-namespaceless-anonymous.exp @@ -30,7 +30,7 @@ Dwarf::assemble $asm_file { cu {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C_plus_plus} - {DW_AT_name dw2-namespaceless-anonymous.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels myint diff --git a/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp b/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp index 496eddc..332e843 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-opt-structptr.exp @@ -41,6 +41,7 @@ proc build_test_program {} { # Make some DWARF for the test. set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { + global srcfile # Creating a CU with 4-byte addresses lets this test link on # both 32- and 64-bit machines. @@ -48,7 +49,7 @@ proc build_test_program {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C99} - {DW_AT_name dw2-opt-structptr.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels int_label struct_label pointer_label \ diff --git a/gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp b/gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp index 1ff7b66..8b984c3 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp +++ b/gdb/testsuite/gdb.dwarf2/dw2-unusual-field-names.exp @@ -62,7 +62,7 @@ proc run_test { field_name } { cu {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C} - {DW_AT_name dw2-unusual-field-names.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels itype ptype stype diff --git a/gdb/testsuite/gdb.dwarf2/enum-type.exp b/gdb/testsuite/gdb.dwarf2/enum-type.exp index 0b12d19..dbb7446 100644 --- a/gdb/testsuite/gdb.dwarf2/enum-type.exp +++ b/gdb/testsuite/gdb.dwarf2/enum-type.exp @@ -24,10 +24,12 @@ standard_testfile main.c -dw.S # Make some DWARF for the test. set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { + global srcfile + cu {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C} - {DW_AT_name enum-type-dw.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels integer_label uinteger_label diff --git a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp index 0ded2c0..82d508a 100644 --- a/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp +++ b/gdb/testsuite/gdb.dwarf2/frame-inlined-in-outer-frame.exp @@ -35,6 +35,8 @@ standard_testfile .S set dwarf_asm [standard_output_file dwarf-asm.S] Dwarf::assemble $dwarf_asm { + global srcfile + declare_labels foo_subprogram bar_subprogram declare_labels stmt_list @@ -43,7 +45,7 @@ Dwarf::assemble $dwarf_asm { cu { addr_size 4 } { DW_TAG_compile_unit { - {DW_AT_name file1.txt} + {DW_AT_name $srcfile} {DW_AT_stmt_list $stmt_list DW_FORM_sec_offset} {DW_AT_language @DW_LANG_C99} {DW_AT_low_pc __cu_low_pc DW_FORM_addr} diff --git a/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp index 210acc1..56fe9d6 100644 --- a/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp +++ b/gdb/testsuite/gdb.dwarf2/info-locals-optimized-out.exp @@ -28,13 +28,13 @@ standard_testfile main.c -dw.S set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { - global dwarf_regnum regname + global dwarf_regnum regname srcfile set buf_var [gdb_target_symbol buf] cu {} { DW_TAG_compile_unit { - {DW_AT_name info-locals-optimized-out.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels int_type_label diff --git a/gdb/testsuite/gdb.dwarf2/main-subprogram.exp b/gdb/testsuite/gdb.dwarf2/main-subprogram.exp index e5470ab..ff08c0a 100644 --- a/gdb/testsuite/gdb.dwarf2/main-subprogram.exp +++ b/gdb/testsuite/gdb.dwarf2/main-subprogram.exp @@ -24,10 +24,12 @@ standard_testfile .c -dw.S # Make some DWARF for the test. set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { + global srcfile + cu {} { DW_TAG_compile_unit { {DW_AT_language @DW_LANG_C} - {DW_AT_name main-subprogram.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels type diff --git a/gdb/testsuite/gdb.dwarf2/missing-type-name.exp b/gdb/testsuite/gdb.dwarf2/missing-type-name.exp index 920b67a..06cabc9 100644 --- a/gdb/testsuite/gdb.dwarf2/missing-type-name.exp +++ b/gdb/testsuite/gdb.dwarf2/missing-type-name.exp @@ -42,11 +42,13 @@ standard_testfile void-type.c void-type.S # Make some DWARF for the test. set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { + global srcfile + cu {} { DW_TAG_compile_unit { {DW_AT_producer "GNU C 8.1"} {DW_AT_language @DW_LANG_C} - {DW_AT_name void-type.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels main_type int_type ptr_type diff --git a/gdb/testsuite/gdb.dwarf2/nonvar-access.exp b/gdb/testsuite/gdb.dwarf2/nonvar-access.exp index 71b726f..20c2daf 100644 --- a/gdb/testsuite/gdb.dwarf2/nonvar-access.exp +++ b/gdb/testsuite/gdb.dwarf2/nonvar-access.exp @@ -27,9 +27,11 @@ standard_testfile main.c -dw.S set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { + global srcfile + cu {} { compile_unit { - {DW_AT_name main.c} + {DW_AT_name $srcfile} } { declare_labels int_type_label char_type_label \ struct_s_label struct_t_label array_a9_label \ diff --git a/gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp b/gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp index b8a1d64..dc91c2f 100644 --- a/gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp +++ b/gdb/testsuite/gdb.dwarf2/typedef-void-finish.exp @@ -29,11 +29,13 @@ standard_testfile void-type.c .S # Make some DWARF for the test. set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { + global srcfile + cu {} { DW_TAG_compile_unit { {DW_AT_producer "GNU C 8.1"} {DW_AT_language @DW_LANG_C} - {DW_AT_name void-type.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels main_type void_typedef diff --git a/gdb/testsuite/gdb.dwarf2/var-access.exp b/gdb/testsuite/gdb.dwarf2/var-access.exp index c0d21ba..82fd5fd 100644 --- a/gdb/testsuite/gdb.dwarf2/var-access.exp +++ b/gdb/testsuite/gdb.dwarf2/var-access.exp @@ -50,13 +50,13 @@ standard_testfile .c -dw.S set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { - global dwarf_regnum regname + global dwarf_regnum regname srcfile set buf_var [gdb_target_symbol buf] cu {} { DW_TAG_compile_unit { - {DW_AT_name var-pieces-dw.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels char_type_label diff --git a/gdb/testsuite/gdb.dwarf2/void-type.exp b/gdb/testsuite/gdb.dwarf2/void-type.exp index 0ffba34..eb8db2c 100644 --- a/gdb/testsuite/gdb.dwarf2/void-type.exp +++ b/gdb/testsuite/gdb.dwarf2/void-type.exp @@ -36,11 +36,13 @@ standard_testfile .c .S # Make some DWARF for the test. set asm_file [standard_output_file $srcfile2] Dwarf::assemble $asm_file { + global srcfile + cu {} { DW_TAG_compile_unit { {DW_AT_producer "Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.5.212 Build 20150212"} {DW_AT_language @DW_LANG_C} - {DW_AT_name void-type.c} + {DW_AT_name $srcfile} {DW_AT_comp_dir /tmp} } { declare_labels int_type void_type ptr_type |