+2020-12-01 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * gdb.threads/non-ldr-exc-1.exp: Use foreach_with_prefix.
+ (do_test): Don't use with_test_prefix.
+ * gdb.threads/non-ldr-exc-2.exp: Use foreach_with_prefix.
+ (do_test): Don't use with_test_prefix.
+ * gdb.threads/non-ldr-exc-3.exp: Use foreach_with_prefix.
+ (do_test): Don't use with_test_prefix.
+ * gdb.threads/non-ldr-exc-4.exp: Use foreach_with_prefix.
+ (do_test): Don't use with_test_prefix.
+
2020-12-01 Simon Marchi <simon.marchi@polymtl.ca>
* gdb.threads/non-ldr-exit.exp: Fix comment.
}
proc do_test { lock_sched nonstop } {
- with_test_prefix "lock-sched=$lock_sched,non-stop=$nonstop" {
- global executable
+ global executable
- save_vars { GDBFLAGS } {
- append GDBFLAGS " -ex \"set non-stop $nonstop\""
- clean_restart ${executable}
- }
-
- if ![runto_main] {
- return -1
- }
+ save_vars { GDBFLAGS } {
+ append GDBFLAGS " -ex \"set non-stop $nonstop\""
+ clean_restart ${executable}
+ }
- gdb_breakpoint [gdb_get_line_number "break-here"]
- gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+ if ![runto_main] {
+ return -1
+ }
- # Also test with sched-lock to make sure we can follow the
- # non-leader thread execing even though the main thread wasn't
- # resumed before the exec.
- if { $lock_sched } {
- gdb_test_no_output "set scheduler-locking on"
- }
+ gdb_breakpoint [gdb_get_line_number "break-here"]
+ gdb_continue_to_breakpoint "break-here" ".* break-here .*"
- if { $nonstop == "on" } {
- gdb_test "thread 2" "Switching.*"
- }
+ # Also test with sched-lock to make sure we can follow the
+ # non-leader thread execing even though the main thread wasn't
+ # resumed before the exec.
+ if { $lock_sched } {
+ gdb_test_no_output "set scheduler-locking on"
+ }
- gdb_test "continue" \
- ".*is executing new program.*Breakpoint 1, main.* at .*" \
- "continue over exec"
+ if { $nonstop == "on" } {
+ gdb_test "thread 2" "Switching.*"
}
+
+ gdb_test "continue" \
+ ".*is executing new program.*Breakpoint 1, main.* at .*" \
+ "continue over exec"
}
-foreach nonstop {"on" "off"} {
- foreach schedlock {"on" "off"} {
- if {$schedlock == "on" && $nonstop == "on"} {
- # Schedule locking has no effect in nonstop mode.
- continue
+foreach_with_prefix nonstop {"on" "off"} {
+ foreach_with_prefix schedlock {"on" "off"} {
+ if {$schedlock == "on" && $nonstop == "on"} {
+ # Schedule locking has no effect in nonstop mode.
+ continue
+ }
+
+ do_test $schedlock $nonstop
}
- do_test $schedlock $nonstop
- }
}
}
proc do_test { lock_sched nonstop } {
- with_test_prefix "lock-sched=$lock_sched,non-stop=$nonstop" {
- global executable
+ global executable
- save_vars { GDBFLAGS } {
- append GDBFLAGS " -ex \"set non-stop $nonstop\""
- clean_restart ${executable}
- }
-
- if ![runto_main] {
- return -1
- }
+ save_vars { GDBFLAGS } {
+ append GDBFLAGS " -ex \"set non-stop $nonstop\""
+ clean_restart ${executable}
+ }
- gdb_breakpoint [gdb_get_line_number "break-here"]
- gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+ if ![runto_main] {
+ return -1
+ }
- if { $nonstop == "on" } {
- gdb_test "thread 2" "Switching.*"
- }
+ gdb_breakpoint [gdb_get_line_number "break-here"]
+ gdb_continue_to_breakpoint "break-here" ".* break-here .*"
- gdb_test "info threads" \
- "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n\\* 2 *Thread \[^\r\n\]* at \[^\r\n\]*" \
- "single thread left"
+ if { $nonstop == "on" } {
+ gdb_test "thread 2" "Switching.*"
+ }
- # Also test with sched-lock to make sure we can follow the
- # non-leader thread execing even though the main thread wasn't
- # resumed before the exec.
- if { $lock_sched } {
- gdb_test_no_output "set scheduler-locking on"
- }
+ gdb_test "info threads" \
+ "\r\n\[ \t\]*Id\[ \t\]+Target\[ \t\]+Id\[ \t\]+Frame\[ \t\]*\r\n\\* 2 *Thread \[^\r\n\]* at \[^\r\n\]*" \
+ "single thread left"
- gdb_test "continue" \
- ".*is executing new program.*Breakpoint 1, main.* at .*" \
- "continue over exec"
+ # Also test with sched-lock to make sure we can follow the
+ # non-leader thread execing even though the main thread wasn't
+ # resumed before the exec.
+ if { $lock_sched } {
+ gdb_test_no_output "set scheduler-locking on"
}
+
+ gdb_test "continue" \
+ ".*is executing new program.*Breakpoint 1, main.* at .*" \
+ "continue over exec"
}
-foreach nonstop {"on" "off"} {
- foreach schedlock {"on" "off"} {
- if {$schedlock == "on" && $nonstop == "on"} {
- # Schedule locking has no effect in nonstop mode.
- continue
+foreach_with_prefix nonstop {"on" "off"} {
+ foreach_with_prefix schedlock {"on" "off"} {
+ if {$schedlock == "on" && $nonstop == "on"} {
+ # Schedule locking has no effect in nonstop mode.
+ continue
+ }
+
+ do_test $schedlock $nonstop
}
- do_test $schedlock $nonstop
- }
}
}
proc do_test { lock_sched nonstop } {
- with_test_prefix "lock-sched=$lock_sched,non-stop=$nonstop" {
- global executable
+ global executable
- save_vars { GDBFLAGS } {
- append GDBFLAGS " -ex \"set non-stop $nonstop\""
- clean_restart ${executable}
- }
-
- if ![runto_main] {
- return -1
- }
+ save_vars { GDBFLAGS } {
+ append GDBFLAGS " -ex \"set non-stop $nonstop\""
+ clean_restart ${executable}
+ }
- gdb_breakpoint [gdb_get_line_number "break-here"]
- gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+ if ![runto_main] {
+ return -1
+ }
- # Also test with sched-lock to make sure we can follow the
- # non-leader thread execing even though the main thread wasn't
- # resumed before the exec.
- if { $lock_sched } {
- gdb_test_no_output "set scheduler-locking on"
- }
+ gdb_breakpoint [gdb_get_line_number "break-here"]
+ gdb_continue_to_breakpoint "break-here" ".* break-here .*"
- if { $nonstop == "on" } {
- gdb_test "thread 2" "Switching.*"
- }
+ # Also test with sched-lock to make sure we can follow the
+ # non-leader thread execing even though the main thread wasn't
+ # resumed before the exec.
+ if { $lock_sched } {
+ gdb_test_no_output "set scheduler-locking on"
+ }
- gdb_test "continue" \
- ".*is executing new program.*Breakpoint 1, main.* at .*" \
- "continue over exec"
+ if { $nonstop == "on" } {
+ gdb_test "thread 2" "Switching.*"
}
+
+ gdb_test "continue" \
+ ".*is executing new program.*Breakpoint 1, main.* at .*" \
+ "continue over exec"
}
-foreach nonstop {"on" "off"} {
- foreach schedlock {"on" "off"} {
- if {$schedlock == "on" && $nonstop == "on"} {
- # Schedule locking has no effect in nonstop mode.
- continue
+foreach_with_prefix nonstop {"on" "off"} {
+ foreach_with_prefix schedlock {"on" "off"} {
+ if {$schedlock == "on" && $nonstop == "on"} {
+ # Schedule locking has no effect in nonstop mode.
+ continue
+ }
+
+ do_test $schedlock $nonstop
}
- do_test $schedlock $nonstop
- }
}
}
proc do_test { lock_sched nonstop } {
- with_test_prefix "lock-sched=$lock_sched,non-stop=$nonstop" {
- global executable
+ global executable
- save_vars { GDBFLAGS } {
- append GDBFLAGS " -ex \"set non-stop $nonstop\""
- clean_restart ${executable}
- }
-
- if ![runto_main] {
- return -1
- }
+ save_vars { GDBFLAGS } {
+ append GDBFLAGS " -ex \"set non-stop $nonstop\""
+ clean_restart ${executable}
+ }
- gdb_breakpoint [gdb_get_line_number "break-here"]
- gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+ if ![runto_main] {
+ return -1
+ }
- # Also test with sched-lock to make sure we can follow the
- # non-leader thread execing even though the main thread wasn't
- # resumed before the exec.
- if { $lock_sched } {
- gdb_test_no_output "set scheduler-locking on"
- }
+ gdb_breakpoint [gdb_get_line_number "break-here"]
+ gdb_continue_to_breakpoint "break-here" ".* break-here .*"
- if { $nonstop == "on" } {
- gdb_test "thread 2" "Switching.*"
- }
+ # Also test with sched-lock to make sure we can follow the
+ # non-leader thread execing even though the main thread wasn't
+ # resumed before the exec.
+ if { $lock_sched } {
+ gdb_test_no_output "set scheduler-locking on"
+ }
- gdb_test "continue" \
- ".*is executing new program.*Breakpoint 1, main.* at .*" \
- "continue over exec"
+ if { $nonstop == "on" } {
+ gdb_test "thread 2" "Switching.*"
}
+
+ gdb_test "continue" \
+ ".*is executing new program.*Breakpoint 1, main.* at .*" \
+ "continue over exec"
}
-foreach nonstop {"on" "off"} {
- foreach schedlock {"on" "off"} {
- if {$schedlock == "on" && $nonstop == "on"} {
- # Schedule locking has no effect in nonstop mode.
- continue
+foreach_with_prefix nonstop {"on" "off"} {
+ foreach_with_prefix schedlock {"on" "off"} {
+ if {$schedlock == "on" && $nonstop == "on"} {
+ # Schedule locking has no effect in nonstop mode.
+ continue
+ }
+
+ do_test $schedlock $nonstop
}
- do_test $schedlock $nonstop
- }
}