From: Tom de Vries Date: Thu, 10 Oct 2024 05:46:06 +0000 (+0200) Subject: [gdb/testsuite] Fix some gdb.dwarf2 test-cases for check-read1 X-Git-Tag: gdb-16-branchpoint~694 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cc72ea8235b5521b00b2ece71713ccc93be7f204;p=thirdparty%2Fbinutils-gdb.git [gdb/testsuite] Fix some gdb.dwarf2 test-cases for check-read1 I ran the testsuite in an environment simulating a stressed system in combination with check-read1. This exposes a few more FAILs. Fix the gdb.dwarf2 ones by using pipe / grep to filter out unnecessary output. Tested on x86_64-linux. --- diff --git a/gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp b/gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp index 59b3db50dbb..2f41db97841 100644 --- a/gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp +++ b/gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp @@ -98,6 +98,7 @@ foreach_with_prefix worker_threads $worker_threads_list { gdb_load $binfile - gdb_test "maint print objfiles" "$eol$ws+qualified:$ws+ns::v$eol.*" \ + gdb_test "pipe maint print objfiles | grep ns::v" \ + "$ws+qualified:$ws+ns::v" \ "v has parent ns" } diff --git a/gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp b/gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp index d8367b0a162..b734c309f9c 100644 --- a/gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp +++ b/gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp @@ -98,6 +98,7 @@ foreach_with_prefix worker_threads $worker_threads_list { gdb_load $binfile - gdb_test "maint print objfiles" "$eol$ws+qualified:$ws+ns::v$eol.*" \ + gdb_test "pipe maint print objfiles | grep ns::v" \ + "$ws+qualified:$ws+ns::v" \ "v has parent ns" } diff --git a/gdb/testsuite/gdb.dwarf2/gdb-index.exp b/gdb/testsuite/gdb.dwarf2/gdb-index.exp index 4e442278f9b..23d60da6a53 100644 --- a/gdb/testsuite/gdb.dwarf2/gdb-index.exp +++ b/gdb/testsuite/gdb.dwarf2/gdb-index.exp @@ -95,7 +95,13 @@ proc local_add_gdb_index { program } { # building an index from a program already using one. set test "check if index present" -gdb_test_multiple "mt print objfiles ${testfile}" $test { +set filter "gdb_index|debug_names|Psymtabs|Cooked" +set cmd "pipe mt print objfiles ${testfile} | grep -E \"$filter\"" +set cmd_re [string_to_regexp $cmd] +gdb_test_multiple $cmd $test { + -re ^$cmd_re { + exp_continue + } -re "gdb_index.*${gdb_prompt} $" { set binfile_with_index $binfile set host_binfile_with_index [gdb_remote_download host $binfile] diff --git a/gdb/testsuite/gdb.dwarf2/pr13961.exp b/gdb/testsuite/gdb.dwarf2/pr13961.exp index a306c45a125..e4ea9d0f8c0 100644 --- a/gdb/testsuite/gdb.dwarf2/pr13961.exp +++ b/gdb/testsuite/gdb.dwarf2/pr13961.exp @@ -36,7 +36,8 @@ gdb_test "break -q main" "Breakpoint.*at.*" pass $testfile # Regression test for PR symtab/30739. -gdb_test_multiple "maint print objfiles $binfile" "no foo::foo" { +set cmd "pipe maint print objfiles $binfile | grep foo::foo" +gdb_test_multiple $cmd "no foo::foo" { -re -wrap "\r\n *qualified: *foo::foo\r\n.*" { fail $gdb_test_name } diff --git a/gdb/testsuite/gdb.dwarf2/self-spec.exp b/gdb/testsuite/gdb.dwarf2/self-spec.exp index 2e8fe6b3933..9bb4064874f 100644 --- a/gdb/testsuite/gdb.dwarf2/self-spec.exp +++ b/gdb/testsuite/gdb.dwarf2/self-spec.exp @@ -59,8 +59,8 @@ require {string eq $index ""} require !readnow -gdb_test "maint print objfiles $testfile" \ - "\r\n *qualified: *c1\r\n.*" \ +gdb_test "pipe maint print objfiles $testfile | grep c1" \ + " *qualified: *c1" \ "class c1 in cooked index" gdb_test "maint expand-symtabs"