[gdb/testsuite] Fix c-linkage-name.exp with {cc-with-gdb-index,readnow}.exp
authorTom de Vries <tdevries@suse.de>
Mon, 30 Mar 2020 08:52:59 +0000 (10:52 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 30 Mar 2020 08:52:59 +0000 (10:52 +0200)
commitc0502da6886e27f344375e471d6a7610a008c404
tree1cd4071244852096bda2393a3852da801e437a73
parentc9fef64dab28713fa94681b593890c38bd43a27c
[gdb/testsuite] Fix c-linkage-name.exp with {cc-with-gdb-index,readnow}.exp

When running test-case gdb.base/c-linkage-name.exp with target board
cc-with-gdb-index.exp, I see:
...
FAIL: gdb.base/c-linkage-name.exp: maint info psymtab: c-linkage-name-2.c: no
FAIL: gdb.base/c-linkage-name.exp: maint info psymtab: c-linkage-name-2.c: yes
...
The FAILs are due to the fact that partial symbol tables are not generated for
indexed executables.

When running the same test-case with target board readnow.exp, I see:
...
FAIL: gdb.base/c-linkage-name.exp: maint info psymtab: c-linkage-name-2.c: no
FAIL: gdb.base/c-linkage-name.exp: print symada__cS before partial symtab \
  expansion
FAIL: gdb.base/c-linkage-name.exp: maint info psymtab: c-linkage-name-2.c: yes
...
The "maint info psymtab" FAILs are also due to fact that the partial symbol
tables not generated, but in this case it's because the symtabs are fully
expanded upon load due to using -readnow.  The "print symada__cS before
partial symtab expansion" test intends to test the state before symbol table
expansion, and with -readnow that's not possible.

Mark these FAILs as UNSUPPORTED.

Tested on x86_64-linux, with native, and target boards cc-with-gdb-index.exp,
cc-with-debug-names.exp and readnow.exp.

gdb/testsuite/ChangeLog:

2020-03-30  Tom de Vries  <tdevries@suse.de>

* gdb.base/c-linkage-name.exp: Use readnow call to mark a test
unsupported.
(verify_psymtab_expanded): Move ...
* lib/gdb.exp (verify_psymtab_expanded): ... here.  Add unsupported
test.
(readnow): New proc.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/c-linkage-name.exp
gdb/testsuite/lib/gdb.exp