From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 95893 invoked by alias); 7 Oct 2019 09:33:16 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 95880 invoked by uid 89); 7 Oct 2019 09:33:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-13.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=weimin, Weimin, field_info, UD:ctfread.c X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Oct 2019 09:33:15 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 366C8B1CA; Mon, 7 Oct 2019 09:33:13 +0000 (UTC) Subject: Re: [PATCH v3] gdb: CTF support To: Weimin Pan , gdb-patches@sourceware.org, Simon Marchi References: <1570143372-27092-1-git-send-email-weimin.pan@oracle.com> From: Tom de Vries Openpgp: preference=signencrypt Message-ID: <596e6b5b-901b-b1ad-fb9a-3a6631f44547@suse.de> Date: Mon, 07 Oct 2019 09:33:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1570143372-27092-1-git-send-email-weimin.pan@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg00181.txt.bz2 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 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