From a1ccc78ea7ba8cad3ff37cbde9b5d3bba0194796 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 25 Oct 2024 06:14:03 +0200 Subject: [PATCH] [gdb/testsuite] Fix some test-cases for check-read1 (-lbl) I ran the testsuite in an environment simulating a stressed system in combination with check-read1. This exposes a few more FAILs. Fix some by using -lbl. Tested on x86_64-linux. --- gdb/testsuite/gdb.base/sect-cmd.exp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/gdb.base/sect-cmd.exp b/gdb/testsuite/gdb.base/sect-cmd.exp index 7d52e317167..2a5758a94c6 100644 --- a/gdb/testsuite/gdb.base/sect-cmd.exp +++ b/gdb/testsuite/gdb.base/sect-cmd.exp @@ -35,12 +35,19 @@ set address1 "" set address2 "" set section_name "" -gdb_test_multiple "info files" "" { - -re -wrap "\\s+($hex) - ($hex) is (\\\$CODE\\\$|\\.text\\S*) in .*" { - set address1 $expect_out(1,string) - set address2 $expect_out(2,string) - set section_name $expect_out(3,string) - pass $gdb_test_name +set ok 0 +gdb_test_multiple "info files" "" -lbl { + -re "\\s+($hex) - ($hex) is (\\\$CODE\\\$|\\.text\\S*) in .*" { + if { ! $ok } { + set address1 $expect_out(1,string) + set address2 $expect_out(2,string) + set section_name $expect_out(3,string) + set ok 1 + } + exp_continue + } + -re -wrap "" { + gdb_assert { $ok } $gdb_test_name } } @@ -56,7 +63,7 @@ if { $address1 == "" || $address2 == "" || $section_name == "" } { # set saw_section_address_line false gdb_test_multiple "section $section_name $address1" \ - "set section $section_name to original address" { + "set section $section_name to original address" -lbl { -re ".*$address1 \- $address2 is $section_name in \[^\r\n\]*" { set saw_section_address_line true exp_continue -- 2.39.5