From fb44b07969b510488a5bd76759b7594445d37ab4 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Thu, 9 Dec 2021 11:15:34 +0100 Subject: [PATCH] [gdb/testsuite] Fix gdb.base/include-main.exp with -readnow With test-case gdb.base/include-main.exp and target board readnow, I run into: ... FAIL: gdb.base/include-main.exp: maint info symtab ... The corresponding check in gdb.base/include-main.exp: ... gdb_test_no_output "maint info symtab" ... checks that no CU was expanded, while -readnow ensures that all CUs are expanded. Fix this by skipping the check with -readnow. Tested on x86_64-linux, with native and target board readnow. --- gdb/testsuite/gdb.base/include-main.exp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.base/include-main.exp b/gdb/testsuite/gdb.base/include-main.exp index 5e5e9495198..28c0a3b4cfa 100644 --- a/gdb/testsuite/gdb.base/include-main.exp +++ b/gdb/testsuite/gdb.base/include-main.exp @@ -32,8 +32,10 @@ gdb_test_no_output "set language c" gdb_load $binfile -# Verify that no CU was expanded. -gdb_test_no_output "maint info symtab" +if { ! [readnow] } { + # Verify that no CU was expanded. + gdb_test_no_output "maint info symtab" +} # List a line in include-main.c. The tricky bit is that there's no code in # include-main.c, so the file should not occur in the .debug_line info. -- 2.30.2