diff options
author | Tom de Vries <tdevries@suse.de> | 2020-10-17 00:10:31 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2020-10-17 00:10:31 +0200 |
commit | d1c8a76d05e3224449cb3849f42e26db6b0eabfe (patch) | |
tree | 04a2961ab26d0fc4ad4d9c0556311a5d01c6f0f5 /gdb/testsuite/lib | |
parent | 874ef0386fe438d654f0c3c230d4a9d0c4db9213 (diff) | |
download | gdb-d1c8a76d05e3224449cb3849f42e26db6b0eabfe.zip gdb-d1c8a76d05e3224449cb3849f42e26db6b0eabfe.tar.gz gdb-d1c8a76d05e3224449cb3849f42e26db6b0eabfe.tar.bz2 |
[gdb/testsuite] Remove hardcoded filenames in gdb.dwarf2/*.exp
There's a common occurance in dwarf assembly test-cases, where a file test.exp
contains:
...
standard_testfile test.c test-dw.S
...
The "test.c" arg can be abbreviated to ".c".
Make standard_testfile treat args with "-" prefix the same as with "." prefix,
such that we can write:
...
standard_testfile .c -dw.S
...
and apply this in gdb.dwarf2/*.exp.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2020-10-17 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (standard_testfile): Also treat args starting with '-'
as suffix.
* gdb.dwarf2/atomic.c: Rename to ...
* gdb.dwarf2/atomic-type.c: ... this.
* gdb.dwarf2/dw2-ranges2.c: Rename to ...
* gdb.dwarf2/dw2-ranges-2.c: ... this.
* gdb.dwarf2/dw2-ranges3.c: Rename to ...
* gdb.dwarf2/dw2-ranges-3.c: ... this.
* gdb.dwarf2/fission-mix2.c: Rename to ...
* gdb.dwarf2/fission-mix-2.c: ... this.
* gdb.dwarf2/ada-linkage-name.exp: Use more suffix args for
standard_testfile.
* gdb.dwarf2/ada-valprint-error.exp: Same.
* gdb.dwarf2/arr-stride.exp: Same.
* gdb.dwarf2/arr-subrange.exp: Same.
* gdb.dwarf2/atomic-type.exp: Same.
* gdb.dwarf2/bad-regnum.exp: Same.
* gdb.dwarf2/break-inline-psymtab.exp: Same.
* gdb.dwarf2/clang-debug-names-2.exp: Same.
* gdb.dwarf2/clang-debug-names.exp: Same.
* gdb.dwarf2/comp-unit-lang.exp: Same.
* gdb.dwarf2/corrupt.exp: Same.
* gdb.dwarf2/count.exp: Same.
* gdb.dwarf2/cpp-linkage-name.exp: Same.
* gdb.dwarf2/data-loc.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-case-insensitive.exp: Same.
* gdb.dwarf2/dw2-cp-infcall-ref-static.exp: Same.
* gdb.dwarf2/dw2-ifort-parameter.exp: Same.
* gdb.dwarf2/dw2-inline-many-frames.exp: Same.
* gdb.dwarf2/dw2-inline-param.exp: Same.
* gdb.dwarf2/dw2-inline-small-func.exp: Same.
* gdb.dwarf2/dw2-inline-stepping.exp: Same.
* gdb.dwarf2/dw2-is-stmt-2.exp: Same.
* gdb.dwarf2/dw2-is-stmt.exp: Same.
* gdb.dwarf2/dw2-line-number-zero.exp: Same.
* gdb.dwarf2/dw2-namespaceless-anonymous.exp: Same.
* gdb.dwarf2/dw2-opt-structptr.exp: Same.
* gdb.dwarf2/dw2-param-error.exp: Same.
* gdb.dwarf2/dw2-ranges-base.exp: Same.
* gdb.dwarf2/dw2-ranges.exp: Same.
* gdb.dwarf2/dw2-unusual-field-names.exp: Same.
* gdb.dwarf2/dw2-vendor-extended-opcode.exp: Same.
* gdb.dwarf2/dw4-sig-types.exp: Same.
* gdb.dwarf2/dynarr-ptr.exp: Same.
* gdb.dwarf2/enum-type.exp: Same.
* gdb.dwarf2/fission-mix.exp: Same.
* gdb.dwarf2/formdata16.exp: Same.
* gdb.dwarf2/implptrconst.exp: Same.
* gdb.dwarf2/implptrpiece.exp: Same.
* gdb.dwarf2/info-locals-optimized-out.exp: Same.
* gdb.dwarf2/main-subprogram.exp: Same.
* gdb.dwarf2/method-ptr.exp: Same.
* gdb.dwarf2/missing-sig-type.exp: Same.
* gdb.dwarf2/nonvar-access.exp: Same.
* gdb.dwarf2/opaque-type-lookup.exp: Same.
* gdb.dwarf2/shortpiece.exp: Same.
* gdb.dwarf2/staticvirtual.exp: Same.
* gdb.dwarf2/subrange.exp: Same.
* gdb.dwarf2/symtab-producer.exp: Same.
* gdb.dwarf2/typedef-void-finish.exp: Same.
* gdb.dwarf2/var-access.exp: Same.
* gdb.dwarf2/variant.exp: Same.
* gdb.dwarf2/void-type.exp: Same.
* gdb.dwarf2/dw2-ranges-psym.exp: Same. Use main.c instead of
dw2-ranges-main.c.
* gdb.dwarf2/dw2-ranges-main.c: Remove.
Diffstat (limited to 'gdb/testsuite/lib')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index d96515b..f53df59 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -5277,7 +5277,7 @@ proc cached_file { filename txt {executable 0}} { # Without any arguments, the .exp file's base name is used to # compute the source file name. The ".c" extension is added in this case. # If ARGS is not empty, each entry is a source file specification. -# If the specification starts with a ".", it is treated as a suffix +# If the specification starts with a "." or "-", it is treated as a suffix # to append to the .exp file's base name. # If the specification is the empty string, it is treated as if it # were ".c". @@ -5324,8 +5324,11 @@ proc standard_testfile {args} { # Handle an extension. if {$arg == ""} { set arg $testfile.c - } elseif {[string range $arg 0 0] == "."} { - set arg $testfile$arg + } else { + set first [string range $arg 0 0] + if { $first == "." || $first == "-" } { + set arg $testfile$arg + } } set $varname $arg |