From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9680 invoked by alias); 26 Jun 2008 19:34:43 -0000 Received: (qmail 9671 invoked by uid 22791); 26 Jun 2008 19:34:42 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 26 Jun 2008 19:34:21 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 74D352A960F; Thu, 26 Jun 2008 15:34:19 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id qG9GMFxns34v; Thu, 26 Jun 2008 15:34:19 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 5A51D2A9608; Thu, 26 Jun 2008 15:34:19 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 1CE10E7ACD; Thu, 26 Jun 2008 15:34:19 -0400 (EDT) Date: Thu, 26 Jun 2008 20:11:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org, Jan Kratochvil Subject: Re: [RFA/RFC/dwarf] detect 0xffffffff size attribute values Message-ID: <20080626193419.GB3586@adacore.com> References: <20080619033241.GA3568@adacore.com> <20080626134046.GC22726@caradoc.them.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="7JfCtLOvnd9MIVvH" Content-Disposition: inline In-Reply-To: <20080626134046.GC22726@caradoc.them.org> User-Agent: Mutt/1.4.2.2i 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: 2008-06/txt/msg00485.txt.bz2 --7JfCtLOvnd9MIVvH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1080 Hi Daniel, > > 2008-06-19 Joel Brobecker > > > > * dwarf2read.c (read_attribute_value): Treat size attribute > > values of 0xffffffff as if the attribute value was zero. > > OK. A complaint when this happens wouldn't be a bad thing, either. Thanks for the review. I am not 100% sure about the complaint, because I presume that this issue happens on a routine basis whenever record types (the equivalent of structs) whose size is dynamic are used. If they are frequent, my concern is that the complaint mechanism would be shut down by several repetitions of the same complaint before giving other complaints a chance to print their message? Perhaps we could decide to define a new complaint category, instead of using the symtab category? In the meantime, I checked the initial patch in, and started testing the following patch: 2008-06-26 Joel Brobecker * dwarf2read.c (read_attribute_value): Issue a complaint when adjusting size attribute values of 0xffffffff as zero. WDYT? -- Joel --7JfCtLOvnd9MIVvH Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dwarf-complaint.diff" Content-length: 705 Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.266 diff -u -p -r1.266 dwarf2read.c --- dwarf2read.c 26 Jun 2008 19:08:10 -0000 1.266 +++ dwarf2read.c 26 Jun 2008 19:25:09 -0000 @@ -6244,7 +6244,13 @@ read_attribute_value (struct attribute * if (attr->name == DW_AT_byte_size && form == DW_FORM_data4 && DW_UNSND (attr) >= 0xffffffff) - DW_UNSND (attr) = 0; + { + complaint + (&symfile_complaints, + _("Suspicious DW_AT_byte_size value treated as zero instead of %lx"), + DW_UNSND (attr)); + DW_UNSND (attr) = 0; + } return info_ptr; } --7JfCtLOvnd9MIVvH--