[gdb/testsuite] Fix some gdb.dwarf2 test-cases for check-read1
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Test passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-arm |
success
|
Test passed
|
Commit Message
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.
---
gdb/testsuite/gdb.dwarf2/backward-spec-inter-cu.exp | 3 ++-
gdb/testsuite/gdb.dwarf2/forward-spec-inter-cu.exp | 3 ++-
gdb/testsuite/gdb.dwarf2/gdb-index.exp | 8 +++++++-
gdb/testsuite/gdb.dwarf2/pr13961.exp | 3 ++-
gdb/testsuite/gdb.dwarf2/self-spec.exp | 4 ++--
5 files changed, 15 insertions(+), 6 deletions(-)
base-commit: 2ae9b1b2d7e5feb0fd734f91250fc5dd187767a5
Comments
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> I ran the testsuite in an environment simulating a stressed system in
Tom> combination with check-read1. This exposes a few more FAILs.
Tom> Fix the gdb.dwarf2 ones by using pipe / grep to filter out unnecessary output.
Tom> - gdb_test "maint print objfiles" "$eol$ws+qualified:$ws+ns::v$eol.*" \
Tom> + gdb_test "pipe maint print objfiles | grep ns::v" \
Tom> + "$ws+qualified:$ws+ns::v" \
Does the test suite already assume that the test host has grep
available?
If so then this seems fine, but if not it means that this is adding a
new dependency.
Tom
On 10/9/24 18:28, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>
> Tom> I ran the testsuite in an environment simulating a stressed system in
> Tom> combination with check-read1. This exposes a few more FAILs.
>
> Tom> Fix the gdb.dwarf2 ones by using pipe / grep to filter out unnecessary output.
>
> Tom> - gdb_test "maint print objfiles" "$eol$ws+qualified:$ws+ns::v$eol.*" \
> Tom> + gdb_test "pipe maint print objfiles | grep ns::v" \
> Tom> + "$ws+qualified:$ws+ns::v" \
>
> Does the test suite already assume that the test host has grep
> available?
>
> If so then this seems fine, but if not it means that this is adding a
> new dependency.
Hi Tom,
thanks for the review.
This seems to be present in 3 other test-cases:
...
$ find gdb/testsuite/gdb.* -type f -name *.exp* | grep -v sigrepeat |
xargs grep grep
gdb/testsuite/gdb.base/shreloc.exp: send_gdb "shell grep -E \"
${var}(\[ \t\]+.*)?\$\" ${msymfile}\n"
gdb/testsuite/gdb.base/maint.exp: gdb_test_multiple "shell grep
'main.*function' $psymbols_output" "" {
gdb/testsuite/gdb.base/maint.exp:gdb_test "shell grep factorial
$msymbols_output" \
gdb/testsuite/gdb.base/maint.exp:gdb_test "shell grep factorial
$msymbols_output" \
gdb/testsuite/gdb.base/maint.exp: gdb_test "shell grep 'main(.*block'
$symbols_output"\
gdb/testsuite/gdb.base/shell.exp:gdb_test "pipe foo truc2 | grep truc |
wc -l" "2" "double pipe"
gdb/testsuite/gdb.base/shell.exp:gdb_test "| foo truc2 | grep truc | wc
-l" "2" "double pipe, pipe char"
gdb/testsuite/gdb.base/shell.exp:gdb_test "|foo|grep truc|wc -l" "1" "no
space around pipe char"
...
So, I'll go ahead and commit this.
Thanks,
- Tom
@@ -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"
}
@@ -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"
}
@@ -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]
@@ -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
}
@@ -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"