From c8ed8c8ac380813b3a5d47131ccad1f79305c16b Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 11 Oct 2021 16:59:56 +0200 Subject: [gdb/testsuite] Fix FAIL in gdb.mi/mi-var-child-f.exp When running test-case gdb.mi/mi-var-child-f.exp on openSUSE Tumbleweed (with glibc 2.34) I run into: ... (gdb) ^M PASS: gdb.mi/mi-var-child-f.exp: mi runto prog_array Expecting: ^(-var-create array \* array[^M ]+)?(\^done,name="array",numchild="[0-9]+",value=".*",type=.*,has_more="0"[^M ]+[(]gdb[)] ^M [ ]*) -var-create array * array^M &"Attempt to use a type name as an expression.\n"^M ^error,msg="-var-create: unable to create variable object"^M (gdb) ^M FAIL: gdb.mi/mi-var-child-f.exp: create local variable array (unexpected output) ... The problem is that the name array is used both: - as the name for a local variable - as the name of a type in glibc, in file malloc/dynarray-skeleton.c, as included by nss/nss_files/files-hosts.c. Fix this by ignoring the shared lib symbols. Likewise in a couple of other fortran tests. Tested on x86_64-linux. --- gdb/testsuite/gdb.mi/mi-var-child-f.exp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gdb/testsuite/gdb.mi') diff --git a/gdb/testsuite/gdb.mi/mi-var-child-f.exp b/gdb/testsuite/gdb.mi/mi-var-child-f.exp index f35c0cd..a1aa1ac 100644 --- a/gdb/testsuite/gdb.mi/mi-var-child-f.exp +++ b/gdb/testsuite/gdb.mi/mi-var-child-f.exp @@ -36,8 +36,14 @@ if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ mi_gdb_reinitialize_dir $srcdir/$subdir mi_gdb_load ${binfile} +# Avoid shared lib symbols. +mi_gdb_test "-gdb-set auto-solib-add off" "\\^done" + mi_runto prog_array +# Avoid libc symbols, in particular the 'array' type. +mi_gdb_test "nosharedlibrary" ".*\\^done" + mi_create_varobj "array" "array" "create local variable array" -- cgit v1.1