return -1
}
+if [mi_gdb_start] {
+ continue
+}
+mi_delete_breakpoints
+mi_gdb_reinitialize_dir $srcdir/$subdir
+mi_gdb_load ${binfile}
+if {![mi_run_to_main]} {
+ return -1
+}
+set libstdcxx_probe_tests_supported [mi_skip_libstdcxx_probe_tests]
+
# Grab some line numbers we'll need.
set catch_1_lineno [gdb_get_line_number "Catch 1"]
set catch_2_lineno [gdb_get_line_number "Catch 2"]
continue_to_breakpoint_in_main
}
-# Now check that all of the command with a regexp that doesn't match,
-# don't trigger.
-with_test_prefix "all with invalid regexp" {
- restart_for_test
- setup_catchpoint "throw" "-r blahblah"
- setup_catchpoint "rethrow" "-r woofwoof"
- setup_catchpoint "catch" "-r miowmiow"
- continue_to_breakpoint_in_main
+if { $libstdcxx_probe_tests_supported == 1 } {
+ # Now check that all of the command with a regexp that doesn't match,
+ # don't trigger.
+ with_test_prefix "all with invalid regexp" {
+ restart_for_test
+ setup_catchpoint "throw" "-r blahblah"
+ setup_catchpoint "rethrow" "-r woofwoof"
+ setup_catchpoint "catch" "-r miowmiow"
+ continue_to_breakpoint_in_main
+ }
+} else {
+ unsupported "all with invalid regexp"
}
-# Now check that all of the commands with a regexp that does match,
-# still trigger.
-with_test_prefix "all with valid regexp" {
- restart_for_test
- setup_catchpoint "throw" "-r my_ex"
- setup_catchpoint "rethrow" "-r _except"
- setup_catchpoint "catch" "-r my_exception"
- continue_to_next_exception "bar" "${throw_1_lineno}" "throw 1"
- continue_to_next_exception "foo" "${catch_1_lineno}" "catch 1"
- continue_to_next_exception "bar" "${throw_1_lineno}" "throw 2"
- continue_to_next_exception "foo" "${catch_1_lineno}" "catch 2"
- continue_to_next_exception "foo" "${throw_2_lineno}" "rethrow 1"
- continue_to_next_exception "main" "${catch_2_lineno}" "catch 3"
- continue_to_next_exception "bar" "${throw_1_lineno}" "throw 3"
- continue_to_next_exception "foo" "${catch_1_lineno}" "catch 4"
- continue_to_next_exception "bar" "${throw_1_lineno}" "throw 4"
- continue_to_next_exception "foo" "${catch_1_lineno}" "catch 5"
- continue_to_next_exception "foo" "${throw_2_lineno}" "rethrow 2"
- continue_to_next_exception "main" "${catch_2_lineno}" "catch 6"
- continue_to_breakpoint_in_main
+if { $libstdcxx_probe_tests_supported == 1 } {
+ # Now check that all of the commands with a regexp that does match,
+ # still trigger.
+ with_test_prefix "all with valid regexp" {
+ restart_for_test
+ setup_catchpoint "throw" "-r my_ex"
+ setup_catchpoint "rethrow" "-r _except"
+ setup_catchpoint "catch" "-r my_exception"
+ continue_to_next_exception "bar" "${throw_1_lineno}" "throw 1"
+ continue_to_next_exception "foo" "${catch_1_lineno}" "catch 1"
+ continue_to_next_exception "bar" "${throw_1_lineno}" "throw 2"
+ continue_to_next_exception "foo" "${catch_1_lineno}" "catch 2"
+ continue_to_next_exception "foo" "${throw_2_lineno}" "rethrow 1"
+ continue_to_next_exception "main" "${catch_2_lineno}" "catch 3"
+ continue_to_next_exception "bar" "${throw_1_lineno}" "throw 3"
+ continue_to_next_exception "foo" "${catch_1_lineno}" "catch 4"
+ continue_to_next_exception "bar" "${throw_1_lineno}" "throw 4"
+ continue_to_next_exception "foo" "${catch_1_lineno}" "catch 5"
+ continue_to_next_exception "foo" "${throw_2_lineno}" "rethrow 2"
+ continue_to_next_exception "main" "${catch_2_lineno}" "catch 6"
+ continue_to_breakpoint_in_main
+ }
+} else {
+ unsupported "all with valid regexp"
}
# Check that the temporary switch works on its own.
continue_to_breakpoint_in_main
}
-# Check that the temporary switch works when used with a regexp.
-restart_for_test
-with_test_prefix "all with -t and regexp" {
- setup_catchpoint "throw" "-t -r my_ex"
- setup_catchpoint "rethrow" "-t -r _except"
- setup_catchpoint "catch" "-t -r my_exception"
- continue_to_next_exception "bar" "${throw_1_lineno}" "throw 1"
- continue_to_next_exception "foo" "${catch_1_lineno}" "catch 1"
- continue_to_next_exception "foo" "${throw_2_lineno}" "rethrow 1"
- continue_to_breakpoint_in_main
+if { $libstdcxx_probe_tests_supported == 1 } {
+ # Check that the temporary switch works when used with a regexp.
+ restart_for_test
+ with_test_prefix "all with -t and regexp" {
+ setup_catchpoint "throw" "-t -r my_ex"
+ setup_catchpoint "rethrow" "-t -r _except"
+ setup_catchpoint "catch" "-t -r my_exception"
+ continue_to_next_exception "bar" "${throw_1_lineno}" "throw 1"
+ continue_to_next_exception "foo" "${catch_1_lineno}" "catch 1"
+ continue_to_next_exception "foo" "${throw_2_lineno}" "rethrow 1"
+ continue_to_breakpoint_in_main
+ }
+} else {
+ unsupported "all with -t and regexp"
}
# Return 0 if we should skip tests that require the libstdc++ stap
# probes. This must be invoked while gdb is running, after shared
-# libraries have been loaded.
-
-proc skip_libstdcxx_probe_tests {} {
- global gdb_prompt
+# libraries have been loaded. PROMPT_REGEXP is the expected prompt.
+proc skip_libstdcxx_probe_tests_prompt { prompt_regexp } {
set ok 0
gdb_test_multiple "info probe" "check for stap probe in libstdc++" {
- -re ".*libstdcxx.*catch.*\r\n$gdb_prompt $" {
+ -re ".*libstdcxx.*catch.*\r\n$prompt_regexp" {
set ok 1
}
- -re "\r\n$gdb_prompt $" {
+ -re "\r\n$prompt_regexp" {
}
}
return $ok
}
+# As skip_libstdcxx_probe_tests_prompt, with gdb_prompt.
+
+proc skip_libstdcxx_probe_tests {} {
+ global gdb_prompt
+ return [skip_libstdcxx_probe_tests_prompt "$gdb_prompt $"]
+}
+
# Return 1 if we should skip tests of the "compile" feature.
# This must be invoked after the inferior has been started.