# HG changeset patch # Parent 8ed1f8219b70efa33fd9525699d984918e07bc4c Skip gdb.base/break.exp catchpoint tests without catchpoints [PR34535] diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -455,6 +455,33 @@ test_tbreak # inappropriately. (There are no calls to those system functions # in this test program.) +set fork_catchpoints_supported 0 + +proc probe_fork_catchpoint {} { + clean_restart break + + if {![runto_main]} { + return + } + + gdb_test "catch fork" "Catchpoint.*fork.*" + + gdb_run_cmd + + set test "probe fork catchpoint" + gdb_test_multiple "" $test { + -re "Your system does not support this type.*" { + unsupported $test + } + -re "$::gdb_prompt $" { + set ::fork_catchpoints_supported 1 + pass $test + } + } +} + +probe_fork_catchpoint + proc_with_prefix test_no_break_on_catchpoint {} { clean_restart break @@ -462,6 +489,10 @@ proc_with_prefix test_no_break_on_catchp return } + if {!$::fork_catchpoints_supported} { + return + } + gdb_test "catch fork" "Catchpoint ${::decimal} \\(fork\\)" \ "set catch fork, never expected to trigger"