gdb/fortran: Don't include module symbols when searching for types

Currently the 'info types' command will return symbols that correspond
to Fortran modules.  This is because the symbols are created with
domain MODULE_DOMAIN and address_class LOC_TYPEDEF.  The address_class
LOC_TYPEDEF is the same address_class used for type symbols which is
why the modules show up when listing types.

This commit explicitly prevents symbols in the MODULE_DOMAIN from
appearing when we search for symbols in the TYPES_DOMAIN, this
prevents the Fortran module symbols from appearing in the output of
'info types'.

gdb/ChangeLog:

	* symtab.c (search_symbols): Don't include MODULE_DOMAIN symbols
	when searching for types.

gdb/testsuite/ChangeLog:

	* gdb.fortran/info-types.exp: Add module.
	* gdb.fortran/info-types.f90: Update expected results.
This commit is contained in:
Andrew Burgess 2019-07-09 15:49:07 +01:00
parent 1f20c35ea4
commit d8f27c6018
5 changed files with 26 additions and 2 deletions

View file

@ -4659,7 +4659,8 @@ search_symbols (const char *regexp, enum search_domain kind,
|| treg_matches_sym_type_name (*treg,
sym)))
|| (kind == TYPES_DOMAIN
&& SYMBOL_CLASS (sym) == LOC_TYPEDEF))))
&& SYMBOL_CLASS (sym) == LOC_TYPEDEF
&& SYMBOL_DOMAIN (sym) != MODULE_DOMAIN))))
{
/* match */
result.emplace_back (i, sym);