From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4525 invoked by alias); 23 Jun 2006 12:39:19 -0000 Received: (qmail 4517 invoked by uid 22791); 23 Jun 2006 12:39:17 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 23 Jun 2006 12:39:16 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FtkwL-0004QT-EO; Fri, 23 Jun 2006 08:39:13 -0400 Date: Fri, 23 Jun 2006 12:39:00 -0000 From: Daniel Jacobowitz To: Jan Kratochvil Cc: gdb-patches@sources.redhat.com Subject: Re: [patch] Fix gdb crash on some missing ELF debug info Message-ID: <20060623123913.GB16879@nevyn.them.org> Mail-Followup-To: Jan Kratochvil , gdb-patches@sources.redhat.com References: <20060623103735.GA28356@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060623103735.GA28356@host0.dyn.jankratochvil.net> User-Agent: Mutt/1.5.11+cvs20060403 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-06/txt/msg00356.txt.bz2 On Fri, Jun 23, 2006 at 12:37:35PM +0200, Jan Kratochvil wrote: > Index: dwarf2read.c > =================================================================== > RCS file: /cvs/src/src/gdb/dwarf2read.c,v > retrieving revision 1.199 > diff -u -p -r1.199 dwarf2read.c > --- dwarf2read.c 14 Jun 2006 15:06:35 -0000 1.199 > +++ dwarf2read.c 23 Jun 2006 10:28:44 -0000 > @@ -9324,7 +9324,9 @@ static void > dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, > struct dwarf2_cu *cu) > { > - if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8) > + if ((attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8) > + /* DW_UNSND (attr) != 0 would produce non-zero bogus ->size & ->data */ > + && dwarf2_per_objfile->loc_size) > { > struct dwarf2_loclist_baton *baton; > The idea is definitely right - thanks! The patch could be a bit better: - We really ought to check that it fits within .debug_loc while we're here. - Comment formatting - comments should end with a period and two spaces. - And I really can't figure out what what you mean by the comment. Do you mean "if we get here, and DW_UNSND (attr) != 0, and we hadn't added the next condition, then we'd end up with bogus ->size"? - Oh, and no ChangeLog You've been submitting a lot of fixes recently; while most of them are small, some are big enough to probably require a copyright assignment. Have you got one, or shall I send you the forms? -- Daniel Jacobowitz CodeSourcery