Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/3] gdb: Improve output from "info types" commad
Date: Thu, 18 Jul 2019 20:07:00 -0000	[thread overview]
Message-ID: <51913d3e-79a3-83a2-9e66-c4f62dd9feab@redhat.com> (raw)
In-Reply-To: <eb7dd0c7840649e94960285e3f4d711d0a4a3cfc.1562931337.git.andrew.burgess@embecosm.com>

On 7/12/19 12:37 PM, Andrew Burgess wrote:
> 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.
> 

That sounds fine to me.

> 	* 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 mobed from...
> 	(_initialize_symtab): ... move and update FIXME comment to above.
> 

Typo: "mobed".

> gdb/testsuite/ChangeLog:
> 
> 	* gdb.base/info-types.c: New file.
> 	* gdb.base/info-types.exp: New file.
> 	* gdb.cp/info-types.cc: New file.
> 	* gdb.cp/info-types.exp: New file.

I'm not immediately seeing what the C++ testcase is trying to
test.  If you replace "class" with struct, and use "typedef struct AA"
instead of "typedef AA", isn't that code basically C code as well?

Also, might it be a good idea to check the info-types.c stuff in
C++ mode as well, to make sure we normalize C and C++ modes?
I.e., make gdb.base/info-types.exp compile once as a C program, and
once as a C++ program?

Thanks,
Pedro Alves


  reply	other threads:[~2019-07-18 20:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12 11:37 [PATCH 0/3] Improving "info types" command Andrew Burgess
2019-07-12 11:37 ` [PATCH 1/3] gdb: Switch "info types" over to use the gdb::options framework Andrew Burgess
2019-07-12 12:48   ` Eli Zaretskii
2019-07-19 14:50     ` Andrew Burgess
2019-07-18 20:07   ` Pedro Alves
2019-07-12 11:37 ` [PATCH 3/3] gdb: Show type summary for anonymous structures from c_print_typedef Andrew Burgess
2019-07-19 12:38   ` Pedro Alves
2019-07-19 21:06     ` Andrew Burgess
2019-07-20 13:47       ` Pedro Alves
2019-07-22 14:10         ` Tom Tromey
2019-07-12 11:37 ` [PATCH 2/3] gdb: Improve output from "info types" commad Andrew Burgess
2019-07-18 20:07   ` Pedro Alves [this message]
2019-07-19 19:43     ` Andrew Burgess
2019-07-19 19:54       ` Pedro Alves
2019-07-20 13:47       ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51913d3e-79a3-83a2-9e66-c4f62dd9feab@redhat.com \
    --to=palves@redhat.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox