diff options
author | Tom de Vries <tdevries@suse.de> | 2019-10-31 23:03:25 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2019-10-31 23:03:25 +0100 |
commit | d1e36019c1f5cc5de8b99dd86cacfbf418fc1c5b (patch) | |
tree | 49b43cdef154e5fc3e5e06dc6fe6849950ab723e /gdb/testsuite/gdb.fortran | |
parent | 8d6efaa20d9b44cc016ae0f55aeceabcfe7d4e68 (diff) | |
download | gdb-d1e36019c1f5cc5de8b99dd86cacfbf418fc1c5b.zip gdb-d1e36019c1f5cc5de8b99dd86cacfbf418fc1c5b.tar.gz gdb-d1e36019c1f5cc5de8b99dd86cacfbf418fc1c5b.tar.bz2 |
[gdb/testsuite] Remove superfluous 3rd argument from gdb_test call (2)
There's a pattern:
...
gdb_test <command> <pattern> <command>
...
that can be written shorter as:
...
gdb_test <command> <pattern>
...
Detect this pattern in proc gdb_test:
...
global gdb_prompt
upvar timeout timeout
if [llength $args]>2 then {
set message [lindex $args 2]
+ if { $message == [lindex $args 0] && [llength $args] == 3 } {
+ error "HERE"
+ }
} else {
set message [lindex $args 0]
}
...
and fix all occurrences in some gdb testsuite subdirs.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2019-10-31 Tom de Vries <tdevries@suse.de>
* gdb.arch/amd64-disp-step-avx.exp: Drop superfluous 3rd argument to
gdb_test.
* gdb.arch/amd64-disp-step.exp: Same.
* gdb.asm/asm-source.exp: Same.
* gdb.btrace/buffer-size.exp: Same.
* gdb.btrace/cpu.exp: Same.
* gdb.btrace/enable.exp: Same.
* gdb.dwarf2/count.exp: Same.
* gdb.dwarf2/dw2-ranges-func.exp: Same.
* gdb.dwarf2/dw2-ranges-psym.exp: Same.
* gdb.fortran/vla-datatypes.exp: Same.
* gdb.fortran/vla-history.exp: Same.
* gdb.fortran/vla-ptype.exp: Same.
* gdb.fortran/vla-value.exp: Same.
* gdb.fortran/whatis_type.exp: Same.
* gdb.guile/guile.exp: Same.
* gdb.multi/tids.exp: Same.
* gdb.python/py-finish-breakpoint.exp: Same.
* gdb.python/py-framefilter.exp: Same.
* gdb.python/py-pp-registration.exp: Same.
* gdb.python/py-xmethods.exp: Same.
* gdb.python/python.exp: Same.
* gdb.server/connect-with-no-symbol-file.exp: Same.
* gdb.server/no-thread-db.exp: Same.
* gdb.server/run-without-local-binary.exp: Same.
* gdb.stabs/weird.exp: Same.
* gdb.threads/attach-many-short-lived-threads.exp: Same.
* gdb.threads/thread-find.exp: Same.
* gdb.threads/tls-shared.exp: Same.
* gdb.threads/tls.exp: Same.
* gdb.threads/wp-replication.exp: Same.
* gdb.trace/ax.exp: Same.
* lib/gdb.exp (gdb_test_exact, help_test_raw): Same.
Change-Id: I2fa544c68f8c0099a77e03ff04ddc010eb2b6c7c
Diffstat (limited to 'gdb/testsuite/gdb.fortran')
-rw-r--r-- | gdb/testsuite/gdb.fortran/vla-datatypes.exp | 15 | ||||
-rw-r--r-- | gdb/testsuite/gdb.fortran/vla-history.exp | 10 | ||||
-rw-r--r-- | gdb/testsuite/gdb.fortran/vla-ptype.exp | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.fortran/vla-value.exp | 4 | ||||
-rw-r--r-- | gdb/testsuite/gdb.fortran/whatis_type.exp | 6 |
5 files changed, 16 insertions, 25 deletions
diff --git a/gdb/testsuite/gdb.fortran/vla-datatypes.exp b/gdb/testsuite/gdb.fortran/vla-datatypes.exp index bb5ed27..c8025c7 100644 --- a/gdb/testsuite/gdb.fortran/vla-datatypes.exp +++ b/gdb/testsuite/gdb.fortran/vla-datatypes.exp @@ -55,16 +55,11 @@ gdb_test "print l" " = \\.TRUE\\." "charactervla allocated" gdb_breakpoint [gdb_get_line_number "vlas-initialized"] gdb_continue_to_breakpoint "vlas-initialized" -gdb_test "ptype intvla" "type = $int, allocatable \\\(11,22,33\\\)" \ - "ptype intvla" -gdb_test "ptype realvla" "type = $real, allocatable \\\(11,22,33\\\)" \ - "ptype realvla" -gdb_test "ptype complexvla" "type = $complex, allocatable \\\(11,22,33\\\)" \ - "ptype complexvla" -gdb_test "ptype logicalvla" "type = $logical, allocatable \\\(11,22,33\\\)" \ - "ptype logicalvla" -gdb_test "ptype charactervla" "type = character\\\*1, allocatable \\\(11,22,33\\\)" \ - "ptype charactervla" +gdb_test "ptype intvla" "type = $int, allocatable \\\(11,22,33\\\)" +gdb_test "ptype realvla" "type = $real, allocatable \\\(11,22,33\\\)" +gdb_test "ptype complexvla" "type = $complex, allocatable \\\(11,22,33\\\)" +gdb_test "ptype logicalvla" "type = $logical, allocatable \\\(11,22,33\\\)" +gdb_test "ptype charactervla" "type = character\\\*1, allocatable \\\(11,22,33\\\)" gdb_test "print intvla(5,5,5)" " = 1" "print intvla(5,5,5) (1st)" gdb_test "print realvla(5,5,5)" " = 3.14\\d+" \ diff --git a/gdb/testsuite/gdb.fortran/vla-history.exp b/gdb/testsuite/gdb.fortran/vla-history.exp index 8737beb..b7ce366 100644 --- a/gdb/testsuite/gdb.fortran/vla-history.exp +++ b/gdb/testsuite/gdb.fortran/vla-history.exp @@ -39,7 +39,7 @@ with_timeout_factor 2 { } # Try to access history values for full vla prints. -gdb_test "print \$1" " = <not allocated>" "print \$1" +gdb_test "print \$1" " = <not allocated>" with_timeout_factor 2 { gdb_test "print \$2" \ " = \\( *\\( *\\( *1311, *1311, *1311,\[()1311, .\]*\\)" "print \$4" @@ -47,9 +47,9 @@ with_timeout_factor 2 { gdb_breakpoint [gdb_get_line_number "vla2-filled"] gdb_continue_to_breakpoint "vla2-filled" -gdb_test "print vla2(1,43,20)" " = 1311" "print vla2(1,43,20)" -gdb_test "print vla1(1,3,8)" " = 1001" "print vla2(1,3,8)" +gdb_test "print vla2(1,43,20)" " = 1311" +gdb_test "print vla1(1,3,8)" " = 1001" # Try to access history values for vla values. -gdb_test "print \$5" " = 1311" "print \$5" -gdb_test "print \$6" " = 1001" "print \$6" +gdb_test "print \$5" " = 1311" +gdb_test "print \$6" " = 1001" diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp index 7f8268b..918ed07 100644 --- a/gdb/testsuite/gdb.fortran/vla-ptype.exp +++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp @@ -55,8 +55,7 @@ gdb_breakpoint [gdb_get_line_number "vla1-filled"] gdb_continue_to_breakpoint "vla1-filled" gdb_test "ptype vla1" "type = $real, allocatable \\\(10,10,10\\\)" \ "ptype vla1 filled" -gdb_test "ptype vla1(3, 6, 9)" "type = $real" \ - "ptype vla1(3, 6, 9)" +gdb_test "ptype vla1(3, 6, 9)" "type = $real" gdb_breakpoint [gdb_get_line_number "vla2-filled"] gdb_continue_to_breakpoint "vla2-filled" @@ -69,8 +68,7 @@ gdb_breakpoint [gdb_get_line_number "pvla-associated"] gdb_continue_to_breakpoint "pvla-associated" gdb_test "ptype pvla" "type = $real \\\(10,10,10\\\)" \ "ptype pvla associated" -gdb_test "ptype pvla(3, 6, 9)" "type = $real" \ - "ptype pvla(3, 6, 9)" +gdb_test "ptype pvla(3, 6, 9)" "type = $real" gdb_breakpoint [gdb_get_line_number "pvla-re-associated"] gdb_continue_to_breakpoint "pvla-re-associated" diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp index ed0cace..5b6ad5d 100644 --- a/gdb/testsuite/gdb.fortran/vla-value.exp +++ b/gdb/testsuite/gdb.fortran/vla-value.exp @@ -148,12 +148,12 @@ gdb_test "print \$myvar" \ "print \$myvar set to vla1" gdb_test "next" "\\d+.*vla1\\(1, 3, 8\\) = 1001" "next (2)" -gdb_test "print \$myvar(3,6,9)" " = 1311" "print \$myvar(3,6,9)" +gdb_test "print \$myvar(3,6,9)" " = 1311" gdb_breakpoint [gdb_get_line_number "pvla-associated"] gdb_continue_to_breakpoint "pvla-associated, second time" gdb_test_no_output "set \$mypvar = pvla" "set \$mypvar = pvla" -gdb_test "print \$mypvar(1,3,8)" " = 1001" "print \$mypvar(1,3,8)" +gdb_test "print \$mypvar(1,3,8)" " = 1001" # deallocate pointer and make sure user defined variable still has the # right value. diff --git a/gdb/testsuite/gdb.fortran/whatis_type.exp b/gdb/testsuite/gdb.fortran/whatis_type.exp index e2ce63a..15306d7 100644 --- a/gdb/testsuite/gdb.fortran/whatis_type.exp +++ b/gdb/testsuite/gdb.fortran/whatis_type.exp @@ -50,14 +50,12 @@ gdb_test "ptype t1" \ [multi_line "type = Type t1" \ " $t1_i" \ " $t1_r" \ - "End Type t1"] \ - "ptype t1" + "End Type t1"] gdb_test "ptype t1v" \ [multi_line "type = Type t1" \ " $t1_i" \ " $t1_r" \ - "End Type t1"] \ - "ptype t1v" + "End Type t1"] gdb_test "ptype t2v" \ [multi_line "type = Type t2" \ |