gdb: Improve output from "info types" commad
authorAndrew Burgess <andrew.burgess@embecosm.com>
Tue, 9 Jul 2019 17:05:59 +0000 (18:05 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Mon, 22 Jul 2019 09:43:02 +0000 (10:43 +0100)
commiteb86c5e2e824787875187901b12fba52ef873278
treee487127c6778dc3e325acb0d882552e46a2610ae
parenta8eab7c6d529ddd248ff5243bb22e9346196e376
gdb: Improve output from "info types" commad

This commit makes two changes to the "info types" command:

First, only use typedef_print for printing typedefs, and use
type_print for printing non-typedef scalar (non-struct) types.  The
result of this is the output for builtin types goes from this:

    typedef double;
    typedef float;
    typedef int;

to this:

    double;
    float;
    int;

which seems to make more sense.

Next GDB no longer matches msymbols as possible type names.  When
looking for function symbols it makes sense to report matching
msymbols from the text sections, and for variables msymbols from the
data/bss sections, but when reporting types GDB would match msymbols
of type absolute.  But I don't see why these are likely to indicate
type names.  As such I've updated the msymbol matching lists in
symtab.c:search_symbols so that when searching in the TYPES_DOMAIN, we
never match any msymbols.

gdb/ChangeLog:

* symtab.c (search_symbols): Adjust msymbol matching type arrays
so that GDB doesn't match any msymbols when searching in the
TYPES_DOMAIN.
(print_symbol_info): Print using typedef_print or type_print based
on the type of the symbol.  Add updated FIXME comment moved from...
(_initialize_symtab): ... move and update FIXME comment to above.

gdb/testsuite/ChangeLog:

* gdb.base/info-types.c: New file.
* gdb.base/info-types.exp: New file.
gdb/ChangeLog
gdb/symtab.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/info-types.c [new file with mode: 0644]
gdb/testsuite/gdb.base/info-types.exp [new file with mode: 0644]
This page took 0.025372 seconds and 4 git commands to generate.