From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30235 invoked by alias); 19 Oct 2011 08:40:34 -0000 Received: (qmail 29949 invoked by uid 22791); 19 Oct 2011 08:40:30 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 19 Oct 2011 08:40:16 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9J8eFXO012365 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 19 Oct 2011 04:40:15 -0400 Received: from host1.jankratochvil.net (ovpn-116-16.ams2.redhat.com [10.36.116.16]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9J8eCmI029580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 19 Oct 2011 04:40:14 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p9J8eB0G010086; Wed, 19 Oct 2011 10:40:11 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p9J8eBvo010085; Wed, 19 Oct 2011 10:40:11 +0200 Date: Wed, 19 Oct 2011 09:01:00 -0000 From: Jan Kratochvil To: John Steele Scott Cc: gdb-patches@sourceware.org Subject: Re: [patch] PR symtab/13277: Resolving opaque structures in ICC generated binaries. Message-ID: <20111019084011.GA9326@host1.jankratochvil.net> References: <4E9A6F3C.6010400@toojays.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E9A6F3C.6010400@toojays.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 X-SW-Source: 2011-10/txt/msg00524.txt.bz2 On Sun, 16 Oct 2011 07:44:28 +0200, John Steele Scott wrote: > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -7636,6 +7636,11 @@ read_structure_type (struct die_info *die, struct dwarf2_cu *cu) > /* RealView does not output the required DW_AT_declaration > on incomplete types. */ > TYPE_STUB (type) = 1; > + else if (attr != NULL&& die->child == NULL&& TYPE_LENGTH (type) == 0 > + && producer_is_icc (cu->producer)) the formatting should be: else if (attr != NULL && die->child == NULL && TYPE_LENGTH (type) == 0 && producer_is_icc (cu->producer)) > + /* ICC does not output the required DW_AT_declaration > + on incomplete types, but gives them a size of zero. */ > + TYPE_STUB (type) = 1; > > /* We need to add the type field to the die immediately so we don't > infinitely recurse when dealing with pointers to the structure > diff --git a/gdb/symtab.c b/gdb/symtab.c > index 9447bd9..ffaa035 100644 > --- a/gdb/symtab.c > +++ b/gdb/symtab.c /* Return non-zero if PRODUCER is Intel C Compiler. */ > +int > +producer_is_icc (const char *producer) This function should have some comment. And it should be static in dwarf2read.c itself as it is not used from any other source file now. OK with those changes. One could make a testcase by hand based for example on gdb.dwarf2/dw2-struct-optimized-out.* . I am not much fond of the `gcc -S' output testcases. But neither is required for a check-in. Thanks, Jan