aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.c
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-07-09 15:49:07 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-08-28 13:33:55 +0100
commitd8f27c6018adbb32a3ebba39a5abac44a6b9e67c (patch)
treea5f5fecd2027826bd2b9cea0a51a9530b54b53cb /gdb/symtab.c
parent1f20c35ea4a0095e6a9d9b7819f6c437a0c4cfc1 (diff)
downloadgdb-d8f27c6018adbb32a3ebba39a5abac44a6b9e67c.zip
gdb-d8f27c6018adbb32a3ebba39a5abac44a6b9e67c.tar.gz
gdb-d8f27c6018adbb32a3ebba39a5abac44a6b9e67c.tar.bz2
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.
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r--gdb/symtab.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 7762c85..88e34de 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -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);