Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Pedro Alves <palves@redhat.com>
Cc: Andrew Burgess <andrew.burgess@embecosm.com>,
	 gdb-patches@sourceware.org
Subject: Re: [PATCH 3/3] gdb: Show type summary for anonymous structures from c_print_typedef
Date: Mon, 22 Jul 2019 14:10:00 -0000	[thread overview]
Message-ID: <875znuw476.fsf@tromey.com> (raw)
In-Reply-To: <1fcef366-f0ca-4503-b5cf-b280120c95cf@redhat.com> (Pedro Alves's	message of "Sat, 20 Jul 2019 14:47:54 +0100")

>> typedef struct {
>> int i;
>> } struct_t;
>> 
>> Both before and after this patch, this is show by 'info types' as:
>> 
>> 3:      typedef struct_t struct_t;

Pedro> Curious, and odd.

There's a weird special case in C++ where this sort of typedef provides
the linkage name for an otherwise anonymous structure, and ages ago we
needed to work around this.

See

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48603#c5

In the DWARF this looks like:

 <1><1d>: Abbrev Number: 2 (DW_TAG_structure_type)
    <1e>   DW_AT_byte_size   : 4
    <1f>   DW_AT_decl_file   : 1
    <20>   DW_AT_decl_line   : 1
    <21>   DW_AT_decl_column : 16
    <22>   DW_AT_linkage_name: (indirect string, offset: 0x0): 8struct_t
    <26>   DW_AT_sibling     : <0x36>

... in particular the linkage name is picked up by gdb.

Search for "47510" in dwar2read.c.  There are a few spots.

Tom


  reply	other threads:[~2019-07-22 14:10 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 [this message]
2019-07-12 11:37 ` [PATCH 2/3] gdb: Improve output from "info types" commad Andrew Burgess
2019-07-18 20:07   ` Pedro Alves
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=875znuw476.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.com \
    /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