+2015-04-10 Pedro Alves <palves@redhat.com>
+
+ * gdb.threads/step-over-lands-on-breakpoint.exp (do_test): New
+ procedure, factored out from ...
+ (top level): ... here. Add "set displaced-stepping" testing axis.
+ * gdb.threads/step-over-trips-on-watchpoint.exp (do_test): New
+ parameter "displaced". Use it.
+ (top level): Use foreach and add "set displaced-stepping" testing
+ axis.
+
2015-04-10 Pedro Alves <palves@redhat.com>
* gdb.threads/step-over-trips-on-watchpoint.c (child_function):
return -1
}
-# Cover both stepping and non-stepping execution commands.
-foreach command {"step" "next" "continue" } {
- with_test_prefix $command {
+# The test proper. DISPLACED is true if we should try with displaced
+# stepping. COMMAND is the execution command to test.
+proc do_test {displaced command} {
+ global executable
+
+ with_test_prefix "displaced=$displaced: $command" {
clean_restart $executable
if ![runto_main] {
continue
}
+ gdb_test_no_output "set displaced-stepping $displaced"
+
gdb_breakpoint [gdb_get_line_number "set wait-thread breakpoint here"]
gdb_continue_to_breakpoint "run to wait-thread breakpoint"
gdb_test "info threads" "2 .*\\\* 1.*" "info threads shows all threads"
gdb_test "$command" "step-over here.*"
}
}
+
+foreach displaced { "off" "on" } {
+ if { $displaced != "off" && ![support_displaced_stepping] } {
+ continue
+ }
+
+ # Cover both stepping and non-stepping execution commands.
+ foreach command { "step" "next" "continue" } {
+ do_test $displaced $command
+ }
+}
return -1
}
-proc do_test { with_bp } {
+# The test proper. DISPLACED is true if we should try with displaced
+# stepping. WITH_BP is true if we should try with a thread-specific
+# breakpoint (for the wrong thread) right after the instruction that
+# triggers the watchpoint.
+proc do_test { displaced with_bp } {
global executable
global gdb_prompt
global hex
} else {
set prefix "no thread-specific bp"
}
- with_test_prefix $prefix {
+ with_test_prefix "displaced=$displaced: $prefix" {
# Cover both stepping and non-stepping execution commands.
foreach command {"step" "next" "continue" } {
with_test_prefix $command {
continue
}
+ gdb_test_no_output "set displaced-stepping $displaced"
+
gdb_breakpoint [gdb_get_line_number "set wait-thread breakpoint here"]
gdb_continue_to_breakpoint "run to wait-thread breakpoint"
gdb_test "info threads" "2 .*\\\* 1.*" "info threads shows all threads"
gdb_test "watch watch_me" "Hardware watchpoint .*"
if ${with_bp} {
- # Set a thread-specific breakpoint (for the wrong
- # thread) right after instruction that triggers
- # the watchpoint.
gdb_test "b *$after_address_triggers_watch thread 1"
}
}
}
-do_test 0
-do_test 1
+foreach displaced { "off" "on" } {
+ if { $displaced != "off" && ![support_displaced_stepping] } {
+ continue
+ }
+
+ foreach with_bp { 0 1 } {
+ do_test $displaced $with_bp
+ }
+}