[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
This commit is contained in:
Tom de Vries
2019-10-31 23:03:25 +01:00
parent 8d6efaa20d
commit d1e36019c1
33 changed files with 175 additions and 181 deletions

View File

@ -1,3 +1,39 @@
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.
2019-10-31 Tom de Vries <tdevries@suse.de>
* gdb.ada/array_bounds.exp: Drop superfluous 3rd argument to gdb_test.

View File

@ -78,11 +78,9 @@ proc disp_step_func { func } {
set test_end_label "${func}_end"
gdb_test "break ${test_start_label}" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break ${test_start_label}"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "break ${test_end_label}" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break ${test_end_label}"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "continue" \
"Continuing.*Breakpoint.*, ${test_start_label} ().*" \

View File

@ -45,18 +45,14 @@ if ![runto_main] then {
# Test call/ret.
gdb_test "break test_call" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break test_call"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "break test_call_end" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break test_call_end"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "break test_ret" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break test_ret"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "break test_ret_end" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break test_ret_end"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "continue" \
"Continuing.*Breakpoint.*, test_call ().*" \
@ -77,18 +73,14 @@ gdb_test "continue" \
# Test abs-jmp/rep-ret.
gdb_test "break test_abs_jmp" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break test_abs_jmp"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "break test_abs_jmp_end" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break test_abs_jmp_end"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "break test_rep_ret" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break test_rep_ret"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "break test_rep_ret_end" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break test_rep_ret_end"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "continue" \
"Continuing.*Breakpoint.*, test_abs_jmp ().*" \
@ -109,11 +101,9 @@ gdb_test "continue" \
# Test syscall.
gdb_test "break test_syscall" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break test_syscall"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "break test_syscall_end" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break test_syscall_end"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "continue" \
"Continuing.*Breakpoint.*, test_syscall ().*" \
@ -128,11 +118,9 @@ gdb_test "continue" \
# These don't occur in normal code, but gdb should still DTRT.
gdb_test "break test_int3" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break test_int3"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "break test_int3_end" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break test_int3_end"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "continue" \
"Continuing.*Breakpoint.*, test_int3 ().*" \
@ -192,11 +180,9 @@ proc rip_test { reg } {
set test_end_label "test_rip_${reg}_end"
gdb_test "break ${test_start_label}" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break ${test_start_label}"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "break ${test_end_label}" \
"Breakpoint.*at.* file .*$srcfile, line.*" \
"break ${test_end_label}"
"Breakpoint.*at.* file .*$srcfile, line.*"
gdb_test "continue" \
"Continuing.*Breakpoint.*, ${test_start_label} ().*" \

View File

@ -421,8 +421,7 @@ gdb_test_multiple "info sources" "info sources" {
# Try 'info line'
gdb_test "info line" \
"Line $line_call_foo3_again of.*asmsrc2.s.*starts at.*<\\.?foo2+.*> and ends at.*<\\.?foo2+.*>." \
"info line"
"Line $line_call_foo3_again of.*asmsrc2.s.*starts at.*<\\.?foo2+.*> and ends at.*<\\.?foo2+.*>."
# Try 'nexting' over next call to foo3
gdb_test "next" "$line_foo2_leave\[ \t\]+gdbasm_leave" "next over foo3"

View File

@ -43,4 +43,4 @@ gdb_test "info record" [multi_line \
"Recording format: \[^\\\r\\\n\]*" \
"Buffer size: 4kB\." \
"Recorded 0 instructions in 0 functions \\\(0 gaps\\\) for \[^\\\r\\\n\]*" \
] "info record"
]

View File

@ -42,11 +42,9 @@ proc test_junk { arg junk current } {
gdb_test "show record btrace cpu" "btrace cpu is 'auto'\." "default cpu"
gdb_test "set record" \
"\"set record\" must be followed by an appropriate subcommand.*" \
"set record"
"\"set record\" must be followed by an appropriate subcommand.*"
gdb_test "set record btrace" \
"\"set record btrace\" must be followed by an appropriate subcommand.*" \
"set record btrace"
"\"set record btrace\" must be followed by an appropriate subcommand.*"
test_bad "" "auto"
test_good "intel: 0/0"

View File

@ -64,7 +64,7 @@ gdb_test "info record" "Active record target: record-btrace\r
Recorded 0 instructions in 0 functions \\\(0 gaps\\\) for thread 1.*\\." "info record without trace"
# stop btrace record
gdb_test "record stop" "Process record is stopped and all execution logs are deleted\\." "record stop"
gdb_test "record stop" "Process record is stopped and all execution logs are deleted\\."
gdb_test "record stop" "No record target is currently active\\..*" "record stop the second time"
# enable btrace again

View File

@ -109,17 +109,17 @@ if ![runto_main] {
return -1
}
gdb_test "ptype array" "type = char \\\[5\\\]" "ptype array"
gdb_test "whatis array" "type = char \\\[5\\\]" "whatis array"
gdb_test "print array" " = \"hello\"" "print array"
gdb_test "print sizeof array" " = 5" "print sizeof array"
gdb_test "ptype array" "type = char \\\[5\\\]"
gdb_test "whatis array" "type = char \\\[5\\\]"
gdb_test "print array" " = \"hello\""
gdb_test "print sizeof array" " = 5"
gdb_test "ptype array2" "type = char \\\[1\\\]" "ptype array"
gdb_test "whatis array2" "type = char \\\[1\\\]" "whatis array"
gdb_test "print array2" " = \"A\"" "print array"
gdb_test "print sizeof array2" " = 1" "print sizeof array"
gdb_test "ptype array2" "type = char \\\[1\\\]"
gdb_test "whatis array2" "type = char \\\[1\\\]"
gdb_test "print array2" " = \"A\""
gdb_test "print sizeof array2" " = 1"
gdb_test "ptype static_array" "type = char \\\[5\\\]" "ptype static_array"
gdb_test "whatis static_array" "type = char \\\[5\\\]" "whatis static_array"
gdb_test "print static_array" " = \"world\"" "print static_array"
gdb_test "print sizeof static_array" " = 5" "print sizeof static_array"
gdb_test "ptype static_array" "type = char \\\[5\\\]"
gdb_test "whatis static_array" "type = char \\\[5\\\]"
gdb_test "print static_array" " = \"world\""
gdb_test "print sizeof static_array" " = 5"

View File

@ -257,8 +257,7 @@ proc do_test {suffix} {
# This is intentional since that behavior is one of the bugs that
# this test case tests for.
gdb_test "break foo" \
"Breakpoint.*at.* file .*$srcfile, line \\d+\\." \
"break foo"
"Breakpoint.*at.* file .*$srcfile, line \\d+\\."
# Continue to foo. Allow execution to stop either on the prologue
# or on the call to bar since either behavior is acceptable though
@ -323,8 +322,7 @@ proc do_test {suffix} {
# This more permissive RE for "break foo" will allow a breakpoint on
# multiple locations to PASS. */
gdb_test "break foo" \
"Breakpoint.*at.*" \
"break foo"
"Breakpoint.*at.*"
gdb_test "break baz" \
"Breakpoint.*at.* file .*$srcfile, line \\d+\\."

View File

@ -134,5 +134,4 @@ if ![runto_main] {
# Note we use a name that is very different from the linkage name, in
# order to not set the breakpoint via minsyms.
gdb_test "break someothername" \
"Breakpoint.*at.*" \
"break someothername"
"Breakpoint.*at.*"

View File

@ -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+" \

View File

@ -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"

View File

@ -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"

View File

@ -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.

View File

@ -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" \

View File

@ -68,7 +68,7 @@ gdb_test_multiline "show guile command" \
gdb_test "source $srcdir/$subdir/source2.scm" "yes" "source source2.scm"
gdb_test "source -s source2.scm" "yes" "source -s source2.scm"
gdb_test "source -s source2.scm" "yes"
gdb_test "guile (print (current-objfile))" "= #f"
gdb_test "guile (print (objfiles))" "= \\(\\)"

View File

@ -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
}
# 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
}
# 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

View File

@ -255,5 +255,5 @@ if ![runto "test_exec_exit"] then {
}
gdb_test "python SimpleFinishBreakpoint(gdb.newest_frame())" "SimpleFinishBreakpoint init" "set FinishBP after the exec"
gdb_test "catch exec" "Catchpoint.*\(exec\).*" "catch exec"
gdb_test "catch exec" "Catchpoint.*\(exec\).*"
gdb_test "continue" "SimpleFinishBreakpoint out of scope.*" "catch out of scope after exec"

View File

@ -85,8 +85,7 @@ gdb_continue_to_breakpoint "Inner test breakpoint"
# Test multiple local blocks.
gdb_test "bt full no-filters" \
".*#0.*end_func.*h = 9.*f = 42.*g = 19.*bar = $hex \"Inside block x2\".*d = 15.*e = 14.*foo = $hex \"Inside block\".*str = $hex \"The End\".*st2 = $hex \"Is Near\".*b = 12.*c = 5.*" \
"bt full no-filters"
".*#0.*end_func.*h = 9.*f = 42.*g = 19.*bar = $hex \"Inside block x2\".*d = 15.*e = 14.*foo = $hex \"Inside block\".*str = $hex \"The End\".*st2 = $hex \"Is Near\".*b = 12.*c = 5.*"
gdb_test "bt full" \
".*#0.*cnuf_dne.*h = 9.*f = 42.*g = 19.*bar = $hex \"Inside block x2\".*d = 15.*e = 14.*foo = $hex \"Inside block\".*str = $hex \"The End\".*st2 = $hex \"Is Near\".*b = 12.*c = 5.*" \
"bt full with filters"
@ -145,8 +144,7 @@ gdb_test "disable frame-filter global NoSuchFilter" \
# Test no-filters
gdb_test "bt no-filters" \
".*#0.*end_func.*#22.*in func1.*#27.*in main \\(\\).*" \
"bt no-filters"
".*#0.*end_func.*#22.*in func1.*#27.*in main \\(\\).*"
# Test reverse
gdb_test "bt" \

View File

@ -58,10 +58,8 @@ proc prepare_test { } {
proc test_printers { s_prefix } {
global hex
gdb_test "print flt" " = x=<42> y=<43>" \
"print flt"
gdb_test "print s" " = ${s_prefix} a=<1> b=<$hex>" \
"print s"
gdb_test "print flt" " = x=<42> y=<43>"
gdb_test "print s" " = ${s_prefix} a=<1> b=<$hex>"
}
# Test registration with verbose off.

View File

@ -159,8 +159,7 @@ gdb_test_no_output "disable xmethod progspace E_methods;method_int" \
gdb_test "info xmethod progspace E_methods;method_int" ".* \\\[disabled\\\]" \
"info xmethod xmethods E_methods;method_int"
gdb_test_no_output "disable xmethod progspace G_methods" "disable G_methods 2"
gdb_test "info xmethod progspace" ".*G_methods \\\[disabled\\\].*" \
"info xmethod progspace"
gdb_test "info xmethod progspace" ".*G_methods \\\[disabled\\\].*"
# PR 18285
# First make sure both are enabled.

View File

@ -94,7 +94,7 @@ gdb_py_test_multiple "indented multi-line python command" \
gdb_test "source $remote_source2_py" "yes" "source source2.py"
gdb_test "source -s source2.py" "yes" "source -s source2.py"
gdb_test "source -s source2.py" "yes"
set remote_source2_symlink_notpy \
[gdb_remote_download host ${srcdir}/${subdir}/source2.py \

View File

@ -50,7 +50,7 @@ proc connect_no_symbol_file { sysroot action } {
# Make sure we're disconnected, in case we're testing with an
# extended-remote board, therefore already connected.
gdb_test "disconnect" ".*" "disconnect"
gdb_test "disconnect" ".*"
# Discard any symbol files that we have opened.
gdb_test "file" ".*" "discard symbol table" \

View File

@ -52,5 +52,4 @@ gdb_continue_to_breakpoint "after tls assignment"
# Printing a tls variable should fail gracefully without a libthread_db.
gdb_test "print foo" \
"Cannot find thread-local storage for Thread \[^,\]+, executable file ${binfile}:\[\r\n\]+Remote target failed to process qGetTLSAddr request" \
"print foo"
"Cannot find thread-local storage for Thread \[^,\]+, executable file ${binfile}:\[\r\n\]+Remote target failed to process qGetTLSAddr request"

View File

@ -39,7 +39,7 @@ save_vars { GDBFLAGS } {
# Make sure we're disconnected, in case we're testing with an
# extended-remote board, therefore already connected.
gdb_test "disconnect" ".*" "disconnect"
gdb_test "disconnect" ".*"
# Let's start gdbserver in extended-remote mode now. We cannot
# use gdbserver_start_extended here because it starts gdbserver,

View File

@ -137,7 +137,7 @@ proc do_tests {} {
print_weird_var attr126
gdb_test "p const69" " = 69" "'e' constant on non-enum type"
gdb_test "whatis const69" "type = (unsigned int|inttype)" "whatis const69"
gdb_test "whatis const69" "type = (unsigned int|inttype)"
gdb_test "p sizeof (const70)" " = 2" "'e' constant with embedded type"
@ -147,7 +147,7 @@ proc do_tests {} {
gdb_test "p constString3" " = \"String3 with embedded quote ' in the middle\"" "string constant 3"
gdb_test "p constString4" { = "String4 with embedded quote \\" in the middle"} "string constant 4"
gdb_test "p bad_neg0" " = \{field0 = 42, field2 =.*field3 = 45\}" "p bad_neg0"
gdb_test "p bad_neg0" " = \{field0 = 42, field2 =.*field3 = 45\}"
gdb_test "ptype inttype" "type = (unsigned int|inttype)" "ptype on inttype"
gdb_test "p sizeof (float72type)" " = 9" "unrecognized floating point type"
@ -155,8 +155,8 @@ proc do_tests {} {
# This big number needs to be kept as one piece
gdb_test "p/x int256var" " = 0x0*2a0000002b0000002c0000002d0000002d0000002c0000002b0000002a" "print very big integer"
gdb_test "whatis consth" "type = inttype" "whatis consth"
gdb_test "whatis consth2" "type = inttype" "whatis consth2"
gdb_test "whatis consth" "type = inttype"
gdb_test "whatis consth2" "type = inttype"
# GDB does not yet understand S constants
setup_xfail "*-*-*"

View File

@ -128,7 +128,7 @@ proc test {} {
# detaching from the program and reattaching, we check that
# the program doesn't die due to gdb leaving a pending
# breakpoint hit on a new thread unprocessed.
gdb_test "break break_fn" "Breakpoint.*" "break break_fn"
gdb_test "break break_fn" "Breakpoint.*"
# Wait a bit, to give time for most threads to hit the
# breakpoint, including threads we might have failed to

View File

@ -276,9 +276,7 @@ gdb_test_multiple "info threads 3-3" "info threads 3-3" {
# Test bad input
gdb_test "info thread foo" \
"Invalid thread ID: foo" \
"info thread foo"
"Invalid thread ID: foo"
gdb_test "info thread foo -1" \
"Invalid thread ID: foo -1" \
"info thread foo -1"
"Invalid thread ID: foo -1"

View File

@ -61,6 +61,4 @@ gdb_test "continue" \
"continue to break"
# This is more of a gcc/glibc test, really.
#
gdb_test "print result" "3" "print result"
gdb_test "print result" "3"

View File

@ -290,10 +290,9 @@ gdb_expect {
runto spin
gdb_test "info address a_global" \
".*a_global.*static storage at address.*" "info address a_global"
".*a_global.*static storage at address.*"
gdb_test "info address me" ".*me.*is a (complex DWARF expression:|variable).*" \
"info address me"
gdb_test "info address me" ".*me.*is a (complex DWARF expression:|variable).*"
# Test LOC_UNRESOLVED references resolving for `extern' TLS variables.

View File

@ -114,8 +114,7 @@ for { set i 0 } { $i < $NR_THREADS } { incr i } {
# in the background for a specific thread.
if {$i < $hwatch_count} {
gdb_test "watch watched_data\[$i\]" \
"Hardware watchpoint .*" \
"watch watched_data\[$i\]"
"Hardware watchpoint .*"
} else {
verbose -log "Not setting watchpoint for watched_data\[$i\]\n"
}

View File

@ -40,99 +40,99 @@ gdb_load $binfile
runto_main
gdb_reinitialize_dir $srcdir/$subdir
gdb_test "maint agent 12" ".*const8 12.*pop.*end.*" "maint agent 12"
gdb_test "maint agent 12" ".*const8 12.*pop.*end.*"
gdb_test "maint agent gdb_char_test" "" "maint agent gdb_char_test"
gdb_test "maint agent gdb_char_test" ""
gdb_test "maint agent gdb_arr_test\[12\]" "" "maint agent gdb_arr_test\[12\]"
gdb_test "maint agent gdb_arr_test\[12\]" ""
gdb_test "maint agent gdb_arr_test\[gdb_short_test\]" "" "maint agent gdb_arr_test\[gdb_short_test\]"
gdb_test "maint agent gdb_arr_test\[gdb_short_test\]" ""
gdb_test "maint agent gdb_struct1_test" "" "maint agent gdb_struct1_test"
gdb_test "maint agent gdb_struct1_test" ""
gdb_test "maint agent gdb_struct1_test.s" "" "maint agent gdb_struct1_test.s"
gdb_test "maint agent gdb_struct1_test.s" ""
gdb_test "maint agent gdb_struct1_test.arr\[gdb_struct1_test.c\]" "" "maint agent gdb_struct1_test.arr\[gdb_struct1_test.c\]"
gdb_test "maint agent gdb_struct1_test.arr\[gdb_struct1_test.c\]" ""
gdb_test "maint agent gdb_structp_test" "" "maint agent gdb_structp_test"
gdb_test "maint agent gdb_structp_test" ""
gdb_test "maint agent gdb_structp_test->l" "" "maint agent gdb_structp_test->l"
gdb_test "maint agent gdb_structp_test->l" ""
gdb_test "maint agent gdb_structp_test->bfield" "" "maint agent gdb_structp_test->bfield"
gdb_test "maint agent gdb_structp_test->bfield" ""
gdb_test "maint agent gdb_long_test + gdb_short_test" "" "maint agent gdb_long_test + gdb_short_test"
gdb_test "maint agent gdb_long_test + gdb_short_test" ""
gdb_test "maint agent gdb_long_test - gdb_short_test" "" "maint agent gdb_long_test - gdb_short_test"
gdb_test "maint agent gdb_long_test - gdb_short_test" ""
gdb_test "maint agent gdb_long_test * gdb_short_test" "" "maint agent gdb_long_test * gdb_short_test"
gdb_test "maint agent gdb_long_test * gdb_short_test" ""
gdb_test "maint agent gdb_long_test / gdb_short_test" "" "maint agent gdb_long_test / gdb_short_test"
gdb_test "maint agent gdb_long_test / gdb_short_test" ""
gdb_test "maint agent gdb_structp_test + 1" "" "maint agent gdb_structp_test + 1"
gdb_test "maint agent gdb_structp_test + 1" ""
gdb_test "maint agent gdb_long_test == gdb_short_test" "" "maint agent gdb_long_test == gdb_short_test"
gdb_test "maint agent gdb_long_test == gdb_short_test" ""
gdb_test "maint agent gdb_long_test != gdb_short_test" "" "maint agent gdb_long_test != gdb_short_test"
gdb_test "maint agent gdb_long_test != gdb_short_test" ""
gdb_test "maint agent gdb_long_test < gdb_short_test" "" "maint agent gdb_long_test < gdb_short_test"
gdb_test "maint agent gdb_long_test < gdb_short_test" ""
gdb_test "maint agent gdb_long_test <= gdb_short_test" "" "maint agent gdb_long_test <= gdb_short_test"
gdb_test "maint agent gdb_long_test <= gdb_short_test" ""
gdb_test "maint agent gdb_long_test > gdb_short_test" "" "maint agent gdb_long_test > gdb_short_test"
gdb_test "maint agent gdb_long_test > gdb_short_test" ""
gdb_test "maint agent gdb_long_test >= gdb_short_test" "" "maint agent gdb_long_test >= gdb_short_test"
gdb_test "maint agent gdb_long_test >= gdb_short_test" ""
gdb_test "maint agent &gdb_long_test == &gdb_short_test" "" "maint agent &gdb_long_test == &gdb_short_test"
gdb_test "maint agent &gdb_long_test == &gdb_short_test" ""
gdb_test "maint agent &gdb_long_test < &gdb_short_test" "" "maint agent &gdb_long_test < &gdb_short_test"
gdb_test "maint agent &gdb_long_test < &gdb_short_test" ""
gdb_test "maint agent (unsigned char)1L" ".*ext 8.*" "maint agent (unsigned char)1L"
gdb_test "maint agent (unsigned char)1L" ".*ext 8.*"
# Now test eval version of agent expressions.
gdb_test "maint agent-eval 12" ".*const8 12.*end.*" "maint agent-eval 12"
gdb_test "maint agent-eval 12" ".*const8 12.*end.*"
gdb_test "maint agent-eval gdb_char_test" "" "maint agent-eval gdb_char_test"
gdb_test "maint agent-eval gdb_char_test" ""
gdb_test "maint agent-eval gdb_arr_test\[12\]" "" "maint agent-eval gdb_arr_test\[12\]"
gdb_test "maint agent-eval gdb_arr_test\[12\]" ""
gdb_test "maint agent-eval gdb_arr_test\[gdb_short_test\]" "" "maint agent-eval gdb_arr_test\[gdb_short_test\]"
gdb_test "maint agent-eval gdb_arr_test\[gdb_short_test\]" ""
gdb_test "maint agent-eval gdb_struct1_test" "" "maint agent-eval gdb_struct1_test"
gdb_test "maint agent-eval gdb_struct1_test" ""
gdb_test "maint agent-eval gdb_struct1_test.s" "" "maint agent-eval gdb_struct1_test.s"
gdb_test "maint agent-eval gdb_struct1_test.s" ""
gdb_test "maint agent-eval gdb_struct1_test.arr\[gdb_struct1_test.c\]" "" "maint agent-eval gdb_struct1_test.arr\[gdb_struct1_test.c\]"
gdb_test "maint agent-eval gdb_struct1_test.arr\[gdb_struct1_test.c\]" ""
gdb_test "maint agent-eval gdb_structp_test" "" "maint agent-eval gdb_structp_test"
gdb_test "maint agent-eval gdb_structp_test" ""
gdb_test "maint agent-eval gdb_structp_test->l" "" "maint agent-eval gdb_structp_test->l"
gdb_test "maint agent-eval gdb_structp_test->l" ""
gdb_test "maint agent-eval gdb_structp_test->bfield" "" "maint agent-eval gdb_structp_test->bfield"
gdb_test "maint agent-eval gdb_structp_test->bfield" ""
gdb_test "maint agent-eval gdb_long_test + gdb_short_test" "" "maint agent-eval gdb_long_test + gdb_short_test"
gdb_test "maint agent-eval gdb_long_test + gdb_short_test" ""
gdb_test "maint agent-eval gdb_long_test - gdb_short_test" "" "maint agent-eval gdb_long_test - gdb_short_test"
gdb_test "maint agent-eval gdb_long_test - gdb_short_test" ""
gdb_test "maint agent-eval gdb_long_test * gdb_short_test" "" "maint agent-eval gdb_long_test * gdb_short_test"
gdb_test "maint agent-eval gdb_long_test * gdb_short_test" ""
gdb_test "maint agent-eval gdb_long_test / gdb_short_test" "" "maint agent-eval gdb_long_test / gdb_short_test"
gdb_test "maint agent-eval gdb_long_test / gdb_short_test" ""
gdb_test "maint agent-eval gdb_structp_test + 1" "" "maint agent-eval gdb_structp_test + 1"
gdb_test "maint agent-eval gdb_structp_test + 1" ""
gdb_test "maint agent-eval gdb_long_test == gdb_short_test" "" "maint agent-eval gdb_long_test == gdb_short_test"
gdb_test "maint agent-eval gdb_long_test == gdb_short_test" ""
gdb_test "maint agent-eval gdb_long_test != gdb_short_test" "" "maint agent-eval gdb_long_test != gdb_short_test"
gdb_test "maint agent-eval gdb_long_test != gdb_short_test" ""
gdb_test "maint agent-eval gdb_long_test < gdb_short_test" "" "maint agent-eval gdb_long_test < gdb_short_test"
gdb_test "maint agent-eval gdb_long_test < gdb_short_test" ""
gdb_test "maint agent-eval gdb_long_test <= gdb_short_test" "" "maint agent-eval gdb_long_test <= gdb_short_test"
gdb_test "maint agent-eval gdb_long_test <= gdb_short_test" ""
gdb_test "maint agent-eval gdb_long_test > gdb_short_test" "" "maint agent-eval gdb_long_test > gdb_short_test"
gdb_test "maint agent-eval gdb_long_test > gdb_short_test" ""
gdb_test "maint agent-eval gdb_long_test >= gdb_short_test" "" "maint agent-eval gdb_long_test >= gdb_short_test"
gdb_test "maint agent-eval gdb_long_test >= gdb_short_test" ""
gdb_test "maint agent-eval &gdb_long_test == &gdb_short_test" ".*equal.*end.*" "maint agent-eval &gdb_long_test == &gdb_short_test"
gdb_test "maint agent-eval &gdb_long_test == &gdb_short_test" ".*equal.*end.*"
gdb_test "maint agent-eval &gdb_long_test < &gdb_short_test" "" "maint agent-eval &gdb_long_test < &gdb_short_test"
gdb_test "maint agent-eval &gdb_long_test < &gdb_short_test" ""

View File

@ -1401,11 +1401,10 @@ proc gdb_test_exact { args } {
regsub -all "\n" $pattern "\r\n" pattern
if [llength $args]==3 then {
set message [lindex $args 2]
} else {
set message $command
return [gdb_test $command $pattern $message]
}
return [gdb_test $command $pattern $message]
return [gdb_test $command $pattern]
}
# Wrapper around gdb_test_multiple that looks for a list of expected
@ -5783,13 +5782,13 @@ proc gdb_gnu_strip_debug { dest args } {
# If third argument TESTNAME is not empty, it's used as the name of the
# test to be printed on pass/fail.
proc help_test_raw { gdb_command expected_lines {testname {}} } {
if {$testname == {}} {
set message $gdb_command
} else {
set message $testname
}
set expected_output [join $expected_lines ""]
gdb_test "${gdb_command}" "${expected_output}" $message
if {$testname != {}} {
gdb_test "${gdb_command}" "${expected_output}" $testname
return
}
gdb_test "${gdb_command}" "${expected_output}"
}
# A regexp that matches the end of help CLASS|PREFIX_COMMAND