From 0f3efefb34f83236ec7d780747103a0b4f3fb6b1 Mon Sep 17 00:00:00 2001 From: Thiago Jung Bauermann Date: Thu, 28 Sep 2023 08:17:54 -0300 Subject: process-dies-while-detaching.exp: Exit early if GDB misses sync breakpoint I'm seeing a lot of variability in the failures of gdb.threads/process-dies-while-detaching.exp on aarch64-linux. On this platform, a problem yet to be investigated causes GDB to miss the _exit breakpoint. What happens next is random because after missing that breakpoint, GDB is out of sync with the inferior. This causes the tests following that point in the testcase to fail in a random way. In this scenario it's better to exit the testcase early to avoid random results in the testsuite. We are relying on gdb_continue_to_breakpoint to return the result of gdb_test_multiple. This is already the case because in Tcl the return value of a function is the return value of the last command it runs. But change gdb_continue_to_breakpoint to explicitly return this value, to make it clear this is the intended behaviour. Tested on aarch64-linux. Tested-By: Guinevere Larsen Approved-By: Andrew Burgess --- gdb/testsuite/lib/gdb.exp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'gdb/testsuite/lib') diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 3cad4f7..0a908e0 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -822,14 +822,14 @@ proc gdb_continue_to_breakpoint {name {location_pattern .*}} { set full_name "continue to breakpoint: $name" set kfail_pattern "Process record does not support instruction 0xfae64 at.*" - gdb_test_multiple "continue" $full_name { + return [gdb_test_multiple "continue" $full_name { -re "(?:Breakpoint|Temporary breakpoint) .* (at|in) $location_pattern\r\n$gdb_prompt $" { pass $full_name } -re "(?:$kfail_pattern)\r\n$gdb_prompt $" { kfail "gdb/25038" $full_name } - } + }] } -- cgit v1.1