This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3] gdb: CTF support
- From: Tom de Vries <tdevries at suse dot de>
- To: Weimin Pan <weimin dot pan at oracle dot com>, gdb-patches at sourceware dot org, Simon Marchi <simon dot marchi at polymtl dot ca>
- Date: Mon, 7 Oct 2019 11:33:12 +0200
- Subject: Re: [PATCH v3] gdb: CTF support
- References: <1570143372-27092-1-git-send-email-weimin.pan@oracle.com>
On 04-10-19 00:56, Weimin Pan wrote:
> +/* The routines that read and process fields/members of a C struct, union,
> + or enumeration, pass lists of data member fields in an instance of a
> + field_info structure. It is derived from dwarf2read.c. */
> +
> +struct nextfield
> +{
> + struct field field {};
> +};
> +
> +struct field_info
Hi,
not only is field_info derived from dwarf2read.c, it uses the same name
for the type. This is a C++ One-Definition-Rule violation, which causes
most of the test-suite to start failing for me.
What happens is that here:
...
if (die->child != NULL && ! die_is_declaration (die, cu))
{
struct field_info fi;
std::vector<struct symbol *> template_args;
...
the constructor for field_info is called, but it calls the constructor
for field_info defined in ctfread.c rather than dwarf2read.c.
Thanks,
- Tom