Skip to content
Commit 49ba92c0 authored by Tom de Vries's avatar Tom de Vries
Browse files

[gdb/testsuite] Fix mi-sym-info.exp matching FAILs

When running gdb.mi/mi-sym-info.exp on openSUSE Leap 15.1, I get:
...
FAIL: gdb.mi/mi-sym-info.exp: List all functions matching type void \
  (unexpected output)
FAIL: gdb.mi/mi-sym-info.exp: -symbol-info-variables --max-results 3 \
  (unexpected output)
FAIL: gdb.mi/mi-sym-info.exp: -symbol-info-types --max-results 4 \
  (unexpected output)
...

The executable contains debug info from files other than the source files:
...
$ readelf -wi mi-sym-info | grep "DW_AT_name.*\.[cS]$" | awk '{print $8}'
../sysdeps/x86_64/start.S
init.c
../sysdeps/x86_64/crti.S
src/gdb/testsuite/gdb.mi/mi-sym-info-1.c
src/gdb/testsuite/gdb.mi/mi-sym-info-2.c
elf-init.c
../sysdeps/x86_64/crtn.S
...

The test does not expect this extra info, resulting in matching failures.

Fix this by restricting the failing commands using --name.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

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

	* gdb.mi/mi-sym-info-2.c (another_char_t, another_short_t): New typedef.
	(var1, var2): New variable.
	* gdb.mi/mi-sym-info.exp: Add --name to various commands to restrict
	matching symbols.
parent 301b21e0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment