+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.
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)"
-}
-
-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)"
+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)"
+ }
}
-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)"
-}
-
-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)"
+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)"
+ }
}
-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"
+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 "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)"
+ }
}
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_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"
+gdb_breakpoint [gdb_get_line_number "fourth breakpoint here"]
+gdb_continue_to_breakpoint "continue to fourth 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)"
+ }
}
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;
}
}
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
}
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;"
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_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"
+gdb_breakpoint [gdb_get_line_number "fourth breakpoint here"]
+gdb_continue_to_breakpoint "continue to fourth 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)"
+ }
}
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)"
+ }
}
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)"
+ }
}