2
0
mirror of https://sourceware.org/git/binutils-gdb.git synced 2025-03-13 13:49:00 +08:00

gdb/testsuite: make test names unique in gdb.arch/*.exp

Make the test names unique in gdb.arch/*.exp by either modifying the
test names or using with_test_prefix.

I have also fixed a typo 'forth' -> 'fourth' throughout gdb.arch/*.

Finally, I replaced code like this:

  gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
           "Breakpoint .* at .*${srcfile}.*" \
           "set first breakpoint in main"

With this:

  gdb_breakpoint [gdb_get_line_number "first breakpoint here"]

In those files that I was already modifying for the other reasons
given above.

gdb/testsuite/ChangeLog:

	* gdb.arch/amd64-byte.exp: Make test names unique, use
	gdb_breakpoint, and fix typo 'forth' -> 'fourth'.
	* gdb.arch/amd64-dword.exp: Likewise.
	* gdb.arch/amd64-pseudo.c: Fix typo 'forth' -> 'fourth'.
	* gdb.arch/amd64-stap-special-operands.exp: Make test names
	unique.
	* gdb.arch/amd64-tailcall-ret.exp: Likewise.
	* gdb.arch/amd64-word.exp: Make test names unique, use
	gdb_breakpoint, and fix typo 'forth' -> 'fourth'.
	* gdb.arch/i386-byte.exp: Make test names unique, use
	gdb_breakpoint.
	* gdb.arch/i386-word.exp: Likewise.
This commit is contained in:
Andrew Burgess 2020-08-26 14:05:45 +01:00
parent 9e7ed8b080
commit c2015ce4a4
9 changed files with 206 additions and 189 deletions

@ -1,3 +1,18 @@
2020-08-27 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.arch/amd64-byte.exp: Make test names unique, use
gdb_breakpoint, and fix typo 'forth' -> 'fourth'.
* gdb.arch/amd64-dword.exp: Likewise.
* gdb.arch/amd64-pseudo.c: Fix typo 'forth' -> 'fourth'.
* gdb.arch/amd64-stap-special-operands.exp: Make test names
unique.
* gdb.arch/amd64-tailcall-ret.exp: Likewise.
* gdb.arch/amd64-word.exp: Make test names unique, use
gdb_breakpoint, and fix typo 'forth' -> 'fourth'.
* gdb.arch/i386-byte.exp: Make test names unique, use
gdb_breakpoint.
* gdb.arch/i386-word.exp: Likewise.
2020-08-25 Shahab Vahedi <shahab@synopsys.com>
* gdb.arch/arc-tdesc-cpu.xml: Use new feature names.

@ -61,73 +61,73 @@ set byte_regs(16) bh
set byte_regs(17) ch
set byte_regs(18) dh
gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set first breakpoint in main"
gdb_breakpoint [gdb_get_line_number "first breakpoint here"]
gdb_continue_to_breakpoint "continue to first breakpoint in main"
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "print/x \$$byte_regs($r)" \
".. = 0x[format %x $r]1" \
"check contents of %$byte_regs($r)"
with_test_prefix "at first bp" {
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "print/x \$$byte_regs($r)" \
".. = 0x[format %x $r]1" \
"check contents of %$byte_regs($r)"
}
for { set r 1 } { $r <= 4 } { incr r } {
set h [expr $r + 14]
gdb_test "print/x \$$byte_regs($h)" \
".. = 0x[format %x $r]2" \
"check contents of %$byte_regs($h)"
}
}
for { set r 1 } { $r <= 4 } { incr r } {
set h [expr $r + 14]
gdb_test "print/x \$$byte_regs($h)" \
".. = 0x[format %x $r]2" \
"check contents of %$byte_regs($h)"
}
gdb_test "break [gdb_get_line_number "second breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set second breakpoint in main"
gdb_breakpoint [gdb_get_line_number "second breakpoint here"]
gdb_continue_to_breakpoint "continue to second breakpoint in main"
for { set r 7 } { $r <= 14 } { incr r } {
gdb_test "print/x \$$byte_regs($r)" \
".. = 0x[format %x $r]1" \
"check contents of %$byte_regs($r)"
with_test_prefix "at second bp" {
for { set r 7 } { $r <= 14 } { incr r } {
gdb_test "print/x \$$byte_regs($r)" \
".. = 0x[format %x $r]1" \
"check contents of %$byte_regs($r)"
}
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "set var \$$byte_regs($r) = $r" "" "set %$byte_regs($r)"
}
for { set r 1 } { $r <= 4 } { incr r } {
set h [expr $r + 14]
gdb_test "set var \$$byte_regs($h) = $h" "" "set %$byte_regs($h)"
}
}
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "set var \$$byte_regs($r) = $r" "" "set %$byte_regs($r)"
}
for { set r 1 } { $r <= 4 } { incr r } {
set h [expr $r + 14]
gdb_test "set var \$$byte_regs($h) = $h" "" "set %$byte_regs($h)"
}
gdb_test "break [gdb_get_line_number "third breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set third breakpoint in main"
gdb_breakpoint [gdb_get_line_number "third breakpoint here"]
gdb_continue_to_breakpoint "continue to third breakpoint in main"
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "print \$$byte_regs($r)" \
".. = $r" \
"check contents of %$byte_regs($r)"
with_test_prefix "at third bp" {
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "print \$$byte_regs($r)" \
".. = $r" \
"check contents of %$byte_regs($r)"
}
for { set r 1 } { $r <= 4 } { incr r } {
set h [expr $r + 14]
gdb_test "print \$$byte_regs($h)" \
".. = $h" \
"check contents of %$byte_regs($h)"
}
for { set r 7 } { $r <= 14 } { incr r } {
gdb_test "set var \$$byte_regs($r) = $r" "" "set %$byte_regs($r)"
}
}
for { set r 1 } { $r <= 4 } { incr r } {
set h [expr $r + 14]
gdb_test "print \$$byte_regs($h)" \
".. = $h" \
"check contents of %$byte_regs($h)"
}
gdb_breakpoint [gdb_get_line_number "fourth breakpoint here"]
gdb_continue_to_breakpoint "continue to fourth breakpoint in main"
for { set r 7 } { $r <= 14 } { incr r } {
gdb_test "set var \$$byte_regs($r) = $r" "" "set %$byte_regs($r)"
}
gdb_test "break [gdb_get_line_number "forth breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set forth breakpoint in main"
gdb_continue_to_breakpoint "continue to forth breakpoint in main"
for { set r 7 } { $r <= 14 } { incr r } {
gdb_test "print \$$byte_regs($r)" \
".. = $r" \
"check contents of %$byte_regs($r)"
with_test_prefix "at fourth bp" {
for { set r 7 } { $r <= 14 } { incr r } {
gdb_test "print \$$byte_regs($r)" \
".. = $r" \
"check contents of %$byte_regs($r)"
}
}

@ -58,56 +58,56 @@ set dword_regs(12) r13d
set dword_regs(13) r14d
set dword_regs(14) r15d
gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set first breakpoint in main"
gdb_breakpoint [gdb_get_line_number "first breakpoint here"]
gdb_continue_to_breakpoint "continue to first breakpoint in main"
for { set r 1 } { $r <= 6 } { incr r } {
set hexr [format %x $r]
gdb_test "print/x \$$dword_regs($r)" \
".. = 0x${hexr}4${hexr}3${hexr}2${hexr}1" \
"check contents of %$dword_regs($r)"
with_test_prefix "at first bp" {
for { set r 1 } { $r <= 6 } { incr r } {
set hexr [format %x $r]
gdb_test "print/x \$$dword_regs($r)" \
".. = 0x${hexr}4${hexr}3${hexr}2${hexr}1" \
"check contents of %$dword_regs($r)"
}
}
gdb_test "break [gdb_get_line_number "second breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set second breakpoint in main"
gdb_breakpoint [gdb_get_line_number "second breakpoint here"]
gdb_continue_to_breakpoint "continue to second breakpoint in main"
for { set r 7 } { $r <= $nr_regs } { incr r } {
set hexr [format %x $r]
gdb_test "print/x \$$dword_regs($r)" \
".. = 0x${hexr}4${hexr}3${hexr}2${hexr}1" \
"check contents of %$dword_regs($r)"
with_test_prefix "at second bp" {
for { set r 7 } { $r <= $nr_regs } { incr r } {
set hexr [format %x $r]
gdb_test "print/x \$$dword_regs($r)" \
".. = 0x${hexr}4${hexr}3${hexr}2${hexr}1" \
"check contents of %$dword_regs($r)"
}
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "set var \$$dword_regs($r) = $r" "" "set %$dword_regs($r)"
}
}
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "set var \$$dword_regs($r) = $r" "" "set %$dword_regs($r)"
}
gdb_test "break [gdb_get_line_number "third breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set third breakpoint in main"
gdb_breakpoint [gdb_get_line_number "third breakpoint here"]
gdb_continue_to_breakpoint "continue to third breakpoint in main"
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "print \$$dword_regs($r)" \
".. = $r" \
"check contents of %$dword_regs($r)"
with_test_prefix "at third bp" {
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "print \$$dword_regs($r)" \
".. = $r" \
"check contents of %$dword_regs($r)"
}
for { set r 7 } { $r <= $nr_regs } { incr r } {
gdb_test "set var \$$dword_regs($r) = $r" "" "set %$dword_regs($r)"
}
}
for { set r 7 } { $r <= $nr_regs } { incr r } {
gdb_test "set var \$$dword_regs($r) = $r" "" "set %$dword_regs($r)"
}
gdb_breakpoint [gdb_get_line_number "fourth breakpoint here"]
gdb_continue_to_breakpoint "continue to fourth breakpoint in main"
gdb_test "break [gdb_get_line_number "forth breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set forth breakpoint in main"
gdb_continue_to_breakpoint "continue to forth breakpoint in main"
for { set r 7 } { $r <= $nr_regs } { incr r } {
gdb_test "print \$$dword_regs($r)" \
".. = $r" \
"check contents of %$dword_regs($r)"
with_test_prefix "at fourth bp" {
for { set r 7 } { $r <= $nr_regs } { incr r } {
gdb_test "print \$$dword_regs($r)" \
".. = $r" \
"check contents of %$dword_regs($r)"
}
}

@ -118,7 +118,7 @@ main (int argc, char **argv)
a temp to build %0. */
"r" (r8), "r" (r9), "r" (r10), "r" (r11),
"r" (r12), "r" (r13), "r" (r14), "r" (r15));
puts ("Bye!"); /* forth breakpoint here */
puts ("Bye!"); /* fourth breakpoint here */
return 0;
}

@ -19,13 +19,15 @@ if { ![istarget "x86_64-*-*"] || ![is_lp64_target] } {
}
proc test_probe { probe_name } {
if { ![runto "-pstap $probe_name"] } {
fail "run to probe $probe_name"
return
}
with_test_prefix "probe: ${probe_name}" {
if { ![runto "-pstap $probe_name"] } {
fail "run to probe $probe_name"
return
}
gdb_test "print \$_probe_argc" " = 1"
gdb_test "print \$_probe_arg0" " = 10"
gdb_test "print \$_probe_argc" " = 1"
gdb_test "print \$_probe_arg0" " = 10"
}
}
standard_testfile amd64-stap-triplet.S

@ -34,11 +34,11 @@ if ![runto_main] {
}
gdb_breakpoint "g"
gdb_continue_to_breakpoint "g" ".* v = 2;"
gdb_continue_to_breakpoint "first time in g" ".* v = 2;"
gdb_test "return" { f \(\); /\* second \*/} "return" \
{Make g return now\? \(y or n\) } "y"
gdb_continue_to_breakpoint "g" ".* v = 2;"
gdb_continue_to_breakpoint "second time in g" ".* v = 2;"
gdb_test "finish" " v = 3;"

@ -58,56 +58,56 @@ set word_regs(12) r13w
set word_regs(13) r14w
set word_regs(14) r15w
gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set first breakpoint in main"
gdb_breakpoint [gdb_get_line_number "first breakpoint here"]
gdb_continue_to_breakpoint "continue to first breakpoint in main"
for { set r 1 } { $r <= 6 } { incr r } {
set hexr [format %x $r]
gdb_test "print/x \$$word_regs($r)" \
".. = 0x${hexr}2${hexr}1" \
"check contents of %$word_regs($r)"
with_test_prefix "at first bp" {
for { set r 1 } { $r <= 6 } { incr r } {
set hexr [format %x $r]
gdb_test "print/x \$$word_regs($r)" \
".. = 0x${hexr}2${hexr}1" \
"check contents of %$word_regs($r)"
}
}
gdb_test "break [gdb_get_line_number "second breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set second breakpoint in main"
gdb_breakpoint [gdb_get_line_number "second breakpoint here"]
gdb_continue_to_breakpoint "continue to second breakpoint in main"
for { set r 7 } { $r <= $nr_regs } { incr r } {
set hexr [format %x $r]
gdb_test "print/x \$$word_regs($r)" \
".. = 0x${hexr}2${hexr}1" \
"check contents of %$word_regs($r)"
with_test_prefix "at second bp" {
for { set r 7 } { $r <= $nr_regs } { incr r } {
set hexr [format %x $r]
gdb_test "print/x \$$word_regs($r)" \
".. = 0x${hexr}2${hexr}1" \
"check contents of %$word_regs($r)"
}
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "set var \$$word_regs($r) = $r" "" "set %$word_regs($r)"
}
}
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "set var \$$word_regs($r) = $r" "" "set %$word_regs($r)"
}
gdb_test "break [gdb_get_line_number "third breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set third breakpoint in main"
gdb_breakpoint [gdb_get_line_number "third breakpoint here"]
gdb_continue_to_breakpoint "continue to third breakpoint in main"
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "print \$$word_regs($r)" \
".. = $r" \
"check contents of %$word_regs($r)"
with_test_prefix "at third bp" {
for { set r 1 } { $r <= 6 } { incr r } {
gdb_test "print \$$word_regs($r)" \
".. = $r" \
"check contents of %$word_regs($r)"
}
for { set r 7 } { $r <= $nr_regs } { incr r } {
gdb_test "set var \$$word_regs($r) = $r" "" "set %$word_regs($r)"
}
}
for { set r 7 } { $r <= $nr_regs } { incr r } {
gdb_test "set var \$$word_regs($r) = $r" "" "set %$word_regs($r)"
}
gdb_breakpoint [gdb_get_line_number "fourth breakpoint here"]
gdb_continue_to_breakpoint "continue to fourth breakpoint in main"
gdb_test "break [gdb_get_line_number "forth breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set forth breakpoint in main"
gdb_continue_to_breakpoint "continue to forth breakpoint in main"
for { set r 7 } { $r <= $nr_regs } { incr r } {
gdb_test "print \$$word_regs($r)" \
".. = $r" \
"check contents of %$word_regs($r)"
with_test_prefix "at fourth bp" {
for { set r 7 } { $r <= $nr_regs } { incr r } {
gdb_test "print \$$word_regs($r)" \
".. = $r" \
"check contents of %$word_regs($r)"
}
}

@ -51,38 +51,38 @@ set byte_regs(6) bh
set byte_regs(7) ch
set byte_regs(8) dh
gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set first breakpoint in main"
gdb_breakpoint [gdb_get_line_number "first breakpoint here"]
gdb_continue_to_breakpoint "continue to first breakpoint in main"
for { set r 1 } { $r <= 4 } { incr r } {
gdb_test "print/x \$$byte_regs($r)" \
".. = 0x[format %x $r]1" \
"check contents of %$byte_regs($r)"
set h [expr $r + 4]
gdb_test "print/x \$$byte_regs($h)" \
".. = 0x[format %x $r]2" \
"check contents of %$byte_regs($h)"
with_test_prefix "at first bp" {
for { set r 1 } { $r <= 4 } { incr r } {
gdb_test "print/x \$$byte_regs($r)" \
".. = 0x[format %x $r]1" \
"check contents of %$byte_regs($r)"
set h [expr $r + 4]
gdb_test "print/x \$$byte_regs($h)" \
".. = 0x[format %x $r]2" \
"check contents of %$byte_regs($h)"
}
for { set r 1 } { $r <= 4 } { incr r } {
gdb_test "set var \$$byte_regs($r) = $r" "" "set %$byte_regs($r)"
set h [expr $r + 4]
gdb_test "set var \$$byte_regs($h) = $h" "" "set %$byte_regs($h)"
}
}
for { set r 1 } { $r <= 4 } { incr r } {
gdb_test "set var \$$byte_regs($r) = $r" "" "set %$byte_regs($r)"
set h [expr $r + 4]
gdb_test "set var \$$byte_regs($h) = $h" "" "set %$byte_regs($h)"
}
gdb_test "break [gdb_get_line_number "second breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set second breakpoint in main"
gdb_breakpoint [gdb_get_line_number "second breakpoint here"]
gdb_continue_to_breakpoint "continue to second breakpoint in main"
for { set r 1 } { $r <= 4 } { incr r } {
gdb_test "print \$$byte_regs($r)" \
".. = $r" \
"check contents of %$byte_regs($r)"
set h [expr $r + 4]
gdb_test "print \$$byte_regs($h)" \
".. = $h" \
"check contents of %$byte_regs($h)"
with_test_prefix "at second bp" {
for { set r 1 } { $r <= 4 } { incr r } {
gdb_test "print \$$byte_regs($r)" \
".. = $r" \
"check contents of %$byte_regs($r)"
set h [expr $r + 4]
gdb_test "print \$$byte_regs($h)" \
".. = $h" \
"check contents of %$byte_regs($h)"
}
}

@ -47,28 +47,28 @@ set word_regs(2) bx
set word_regs(3) cx
set word_regs(4) dx
gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set first breakpoint in main"
gdb_breakpoint [gdb_get_line_number "first breakpoint here"]
gdb_continue_to_breakpoint "continue to first breakpoint in main"
for { set r 1 } { $r <= 4 } { incr r } {
gdb_test "print/x \$$word_regs($r)" \
".. = 0x[format %x $r]2[format %x $r]1" \
"check contents of %$word_regs($r)"
with_test_prefix "at first bp" {
for { set r 1 } { $r <= 4 } { incr r } {
gdb_test "print/x \$$word_regs($r)" \
".. = 0x[format %x $r]2[format %x $r]1" \
"check contents of %$word_regs($r)"
}
for { set r 1 } { $r <= 4 } { incr r } {
gdb_test "set var \$$word_regs($r) = $r" "" "set %$word_regs($r)"
}
}
for { set r 1 } { $r <= 4 } { incr r } {
gdb_test "set var \$$word_regs($r) = $r" "" "set %$word_regs($r)"
}
gdb_test "break [gdb_get_line_number "second breakpoint here"]" \
"Breakpoint .* at .*${srcfile}.*" \
"set second breakpoint in main"
gdb_breakpoint [gdb_get_line_number "second breakpoint here"]
gdb_continue_to_breakpoint "continue to second breakpoint in main"
for { set r 1 } { $r <= 4 } { incr r } {
gdb_test "print \$$word_regs($r)" \
".. = $r" \
"check contents of %$word_regs($r)"
with_test_prefix "at second bp" {
for { set r 1 } { $r <= 4 } { incr r } {
gdb_test "print \$$word_regs($r)" \
".. = $r" \
"check contents of %$word_regs($r)"
}
}