From 06db6ec3d97836d4609d03ac3a3d4e104ad879be Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 27 Oct 2020 23:17:09 +0100 Subject: [PATCH] [gdb/testsuite] Fix gdb.cp/psymtab-parameter.exp with -readnow When running test-case gdb.cp/psymtab-parameter.exp with target board readnow, we run into: ... FAIL: gdb.cp/psymtab-parameter.exp: maintenance info symtabs ... The FAIL is expected, as mentioned in the comment: ... # The goal is to keep the CU (Compilation Unit) unexpanded. It would be # rather XFAIL than FAIL here. For example -readnow breaks it. gdb_test_no_output "maintenance info symtabs" ... Fix the FAIL by skipping the command for -readnow. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-10-27 Tom de Vries * gdb.cp/psymtab-parameter.exp: Don't expect unexpanded CU for -readnow. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.cp/psymtab-parameter.exp | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a260377b9fa..472e74d9d35 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-10-27 Tom de Vries + + * gdb.cp/psymtab-parameter.exp: Don't expect unexpanded CU for + -readnow. + 2020-10-14 Gary Benson * gdb.python/py-format-string.exp (test_deref_refs): Treat diff --git a/gdb/testsuite/gdb.cp/psymtab-parameter.exp b/gdb/testsuite/gdb.cp/psymtab-parameter.exp index 825e3f4a61c..4253cf59ad7 100644 --- a/gdb/testsuite/gdb.cp/psymtab-parameter.exp +++ b/gdb/testsuite/gdb.cp/psymtab-parameter.exp @@ -27,9 +27,10 @@ clean_restart $testfile.x # As `main' is not present GDB fails to find the proper inferior language. gdb_test_no_output "set language c++" -# The goal is to keep the CU (Compilation Unit) unexpanded. It would be rather -# XFAIL than FAIL here. For example -readnow breaks it. -gdb_test_no_output "maintenance info symtabs" +if { ![readnow] } { + # Check that the the CU (Compilation Unit) is unexpanded. + gdb_test_no_output "maintenance info symtabs" +} # GDB has shown only the `long func()' ELF symbol before, not the DWARF # symbol -- 2.30.2