[gdb/testsuite] Fix gdb.mi/mi-info-sources.exp for extra debug info
authorTom de Vries <tdevries@suse.de>
Mon, 12 Jul 2021 11:13:38 +0000 (13:13 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 12 Jul 2021 11:13:38 +0000 (13:13 +0200)
commitc33be6de41550bf38ab08cd73936c4ea164bc736
tree5651f90e75a9a9ae699e98a43e7ff922446f1666
parent7790aa804e0ef9f93ca6037f4a19860c4291bd54
[gdb/testsuite] Fix gdb.mi/mi-info-sources.exp for extra debug info

When running test-case gdb.mi/mi-info-sources.exp, I run into:
...
Running src/gdb/testsuite/gdb.mi/mi-info-sources.exp ...
ERROR: internal buffer is full.
...
due to extra debug info from the shared libraries.

Fix this by using "nosharedlibrary".

Then I run into these FAILs:
...
FAIL: gdb.mi/mi-info-sources.exp: debug_read=false: \
  -file-list-exec-source-files (unexpected output)
FAIL: gdb.mi/mi-info-sources.exp: debug_read=true: \
  -file-list-exec-source-files (unexpected output)
FAIL: gdb.mi/mi-info-sources.exp: debug_read=true: \
  -file-list-exec-source-files --group-by-objfile, look for \
  mi-info-sources.c (unexpected output)
FAIL: gdb.mi/mi-info-sources.exp: debug_read=true: \
  -file-list-exec-source-files --group-by-objfile, look for \
  mi-info-sources-base.c (unexpected output)
...
due to openSUSE executables which have debug info for objects from sources
like sysdeps/x86_64/crtn.S.

Fix these by updating the patterns, and adding "maint expand-symtabs" to
reliably get fully-read objfiles.

Then I run into FAILs when using the readnow target board.  Fix these by
skipping the relevant tests.

Then I run into FAILs when using the cc-with-gnu-debuglink board.  Fix these
by updating the patterns.

Tested on x86_64-linux, with native, check-read1, readnow, cc-with-gdb-index,
cc-with-debug-names, cc-with-gnu-debuglink, cc-with-dwz, cc-with-dwz-m.

gdb/testsuite/ChangeLog:

2021-07-05  Tom de Vries  <tdevries@suse.de>

* lib/mi-support.exp (mi_readnow): New proc.
* gdb.mi/mi-info-sources.exp: Use nosharedlibrary.  Update patterns.
Skip tests for readnow.  Use "maint expand-symtabs".
gdb/testsuite/gdb.mi/mi-info-sources.exp
gdb/testsuite/lib/mi-support.exp