binutils-gdb/gdb/testsuite/gdb.fortran
Tom de Vries ea17b3d59f [gdb/testsuite] Fix gdb.fortran/call-no-debug.exp symbol search
On openSUSE Tumbleweed I ran into:
...
(gdb) ptype outstring_func.part^M
No symbol "outstring_func" in current context.^M
(gdb) FAIL: gdb.fortran/call-no-debug.exp: ptype outstring_func.part
...
while on openSUSE Leap 15.2 I have instead:
...
(gdb) ptype string_func_^M
type = <unknown return type> ()^M
(gdb) PASS: gdb.fortran/call-no-debug.exp: ptype string_func_
...

The difference is caused by the result for "info function string_func", which
is this for the latter:
...
(gdb) info function string_func^M
All functions matching regular expression "string_func":^M
^M
Non-debugging symbols:^M
0x000000000040089c  string_func_^M
...
but this for the former:
...
(gdb) info function string_func^M
All functions matching regular expression "string_func":^M
^M
Non-debugging symbols:^M
0x00000000004012bb  string_func_^M
0x00007ffff7bac5b0  outstring_func.part^M
0x00007ffff7bb1a00  outstring_func.part^M
...

The extra symbols are part of glibc:
...
$ nm /lib64/libc.so.6 | grep string_func
00000000000695b0 t outstring_func.part.0
000000000006ea00 t outstring_func.part.0
...

If glibc debug info is installed, we get instead:
...
(gdb) info function string_func^M
All functions matching regular expression "string_func":^M
^M
File /usr/src/debug/glibc-2.33-9.1.x86_64/stdio-common/vfprintf-internal.c:^M
236:    static int outstring_func(int, size_t, const unsigned int *, FILE *);^M
^M
File vfprintf-internal.c:^M
236:    static int outstring_func(int, size_t, const unsigned char *, FILE *);^M
^M
Non-debugging symbols:^M
0x00000000004012bb  string_func_^M
...
and the FAIL doesn't trigger.

Fix this by calling "info function string_func" before starting the exec, such
that only symbols of the exec are taken into account.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2021-09-01  Tom de Vries  <tdevries@suse.de>

	* gdb.fortran/call-no-debug.exp: Avoid shared lib symbols for
	find_mangled_name calls.
2021-09-01 11:25:39 +02:00
..
allocated.exp gdb/fortran: support ALLOCATED builtin 2021-02-12 09:22:17 +00:00
allocated.f90 gdb/fortran: support ALLOCATED builtin 2021-02-12 09:22:17 +00:00
array-bounds-high.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-bounds-high.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-bounds.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-bounds.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-element.exp gdb/fortran: Breakpoint location is modified. 2021-05-11 17:50:00 +05:30
array-element.f Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-slices-bad.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-slices-bad.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-slices-sub-slices.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-slices-sub-slices.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
array-slices.exp gdb/testsuite: remove actual addresses from some test names 2021-01-18 17:06:12 +00:00
array-slices.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
associated.exp gdb/testsuite: Add a missing -wrap in gdb_test_multiple 2021-02-25 16:38:03 +00:00
associated.f90 gdb/fortran: add support for ASSOCIATED builtin 2021-02-25 10:09:11 +00:00
block-data.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
block-data.f Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
call-no-debug-func.f90 gdb/fortran: don't access non-existent type fields 2021-02-25 10:33:12 +00:00
call-no-debug-prog.f90 gdb/fortran: don't access non-existent type fields 2021-02-25 10:33:12 +00:00
call-no-debug.exp [gdb/testsuite] Fix gdb.fortran/call-no-debug.exp symbol search 2021-09-01 11:25:39 +02:00
charset.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
charset.f90
class-allocatable-array.exp gdb/fortran: test case modified to suit the clang behavior. 2021-05-17 12:22:19 +05:30
class-allocatable-array.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
common-block.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
common-block.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
completion.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
completion.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
complex.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
complex.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
debug-expr.exp Convert f-exp.y to use operations 2021-03-08 07:28:39 -07:00
debug-expr.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
derived-type-function.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
derived-type-function.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
derived-type-striding.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
derived-type-striding.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
derived-type.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
derived-type.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
dot-ops.exp gdb/fortran: add support for legacy .xor. operator 2021-02-25 10:07:44 +00:00
dynamic-ptype-whatis.exp [gdb/testsuite] Disallow single argument in multi_line 2021-06-08 17:39:05 +02:00
dynamic-ptype-whatis.f90 gdb/fortran: handle dynamic types within arrays and structures 2021-04-07 17:19:46 +01:00
exprs.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
function-calls.exp [gdb/symtab] Fix element type modification in read_array_type 2021-02-09 23:28:16 +01:00
function-calls.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
info-modules.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
info-types-2.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
info-types.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
info-types.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
intrinsics.exp gdb/fortran: Add 'LOC' intrinsic support. 2021-03-09 11:34:55 +01:00
intrinsics.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
intvar-array.exp gdb/fortran: Correct the lval type for array elements of internal vars 2021-01-08 09:54:21 +00:00
intvar-array.f90 gdb/fortran: Correct the lval type for array elements of internal vars 2021-01-08 09:54:21 +00:00
intvar-dynamic-types.exp gdb: user variables with components of dynamic type 2021-01-08 11:52:56 +00:00
intvar-dynamic-types.f90 gdb: user variables with components of dynamic type 2021-01-08 11:52:56 +00:00
lbound-ubound.exp gdb/testsuite: remove old comment 2021-02-11 11:32:09 +00:00
lbound-ubound.F90 gdb/fortran: add parser support for lbound and ubound 2021-02-10 16:03:49 +00:00
library-module-lib.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
library-module-main.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
library-module.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
logical.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
logical.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
max-depth.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
max-depth.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
mixed-lang-stack.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
mixed-lang-stack.cpp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
mixed-lang-stack.exp [gdb/testsuite] Add KFAILs for PR symtab/24549 2021-02-05 10:56:39 +01:00
mixed-lang-stack.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
module.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
module.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
multi-dim.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
multi-dim.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
nested-funcs-2.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
nested-funcs-2.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
nested-funcs.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
nested-funcs.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
pointer-to-pointer.exp gdb: call value_ind for pointers to dynamic types in UNOP_IND evaluation 2021-02-24 15:51:29 +00:00
pointer-to-pointer.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
pointers.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
print-formatted.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
print-formatted.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
print_type.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
printing-types.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
printing-types.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ptr-indentation.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ptr-indentation.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
ptype-on-functions.exp [gdb/testsuite] Fix fail in gdb.fortran/ptype-on-functions.exp with gcc-7 2021-07-05 16:26:42 +02:00
ptype-on-functions.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
rank.exp gdb/fortran: add support for RANK keyword 2021-03-09 09:45:18 +00:00
rank.f90 gdb/fortran: add support for RANK keyword 2021-03-09 09:45:18 +00:00
shape.exp gdb/fotran: add support for the 'shape' keyword 2021-03-09 09:51:23 +00:00
shape.f90 gdb/fotran: add support for the 'shape' keyword 2021-03-09 09:51:23 +00:00
short-circuit-argument-list.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
short-circuit-argument-list.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
size.exp gdb/fortran: add support for 'SIZE' keyword 2021-03-09 09:51:23 +00:00
size.f90 gdb/fortran: add support for 'SIZE' keyword 2021-03-09 09:51:23 +00:00
subarray.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
subarray.f Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
type-kinds.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
type.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
types.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-alloc-assoc.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-datatypes.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-datatypes.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-history.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-ptr-info.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-ptype-sub.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-ptype.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-sizeof.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-sub.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-type.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-type.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-value-sub-arbitrary.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-value-sub-finish.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-value-sub.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla-value.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
vla.f90 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
whatis_type.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00