aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.multi/tids.exp
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2019-10-31 23:03:25 +0100
committerTom de Vries <tdevries@suse.de>2019-10-31 23:03:25 +0100
commitd1e36019c1f5cc5de8b99dd86cacfbf418fc1c5b (patch)
tree49b43cdef154e5fc3e5e06dc6fe6849950ab723e /gdb/testsuite/gdb.multi/tids.exp
parent8d6efaa20d9b44cc016ae0f55aeceabcfe7d4e68 (diff)
downloadgdb-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.multi/tids.exp')
-rw-r--r--gdb/testsuite/gdb.multi/tids.exp18
1 files changed, 10 insertions, 8 deletions
diff --git a/gdb/testsuite/gdb.multi/tids.exp b/gdb/testsuite/gdb.multi/tids.exp
index 477806b..e5113f1 100644
--- a/gdb/testsuite/gdb.multi/tids.exp
+++ b/gdb/testsuite/gdb.multi/tids.exp
@@ -52,10 +52,12 @@ proc thread_apply {tid_list exp_tid_list {message ""}} {
}
set cmd "thread apply $tid_list"
- if {$message == ""} {
- set message $cmd
+ if {$message != ""} {
+ gdb_test "$cmd p 1234" $r $message
+ return
}
- gdb_test "$cmd p 1234" $r $message
+
+ gdb_test "$cmd p 1234" $r
}
# Issue "info threads TID_LIST" and expect EXP_TID_LIST (a list of
@@ -66,10 +68,11 @@ proc info_threads {tid_list exp_tid_list {message ""}} {
set r [join $expected " ${any}\r\n${any} "]
set r "${any} $r ${any}"
set cmd "info threads $tid_list"
- if {$message == ""} {
- set message $cmd
+ if {$message != ""} {
+ gdb_test $cmd $r $message
+ return
}
- gdb_test $cmd $r $message
+ gdb_test $cmd $r
}
# Issue "info threads TID_LIST" and expect INFO_THR output. Then
@@ -96,8 +99,7 @@ proc thr_apply_info_thr_error {tid_list exp_error_apply {exp_error_info ""}} {
$exp_error_info
gdb_test "thread apply $tid_list" \
- $exp_error_apply \
- "thread apply $tid_list"
+ $exp_error_apply
}
# Issue both "info threads TID_LIST" and "thread apply TID_LIST" and