From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25568 invoked by alias); 12 Jul 2006 21:15:37 -0000 Received: (qmail 25559 invoked by uid 22791); 12 Jul 2006 21:15:37 -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; Wed, 12 Jul 2006 21:15:35 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1G0m3R-00005H-NN; Wed, 12 Jul 2006 17:15:33 -0400 Date: Wed, 12 Jul 2006 21:15: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: <20060712211533.GU24622@nevyn.them.org> Mail-Followup-To: Jan Kratochvil , gdb-patches@sources.redhat.com References: <20060623103735.GA28356@host0.dyn.jankratochvil.net> <20060623123913.GB16879@nevyn.them.org> <20060623130732.GA28950@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060623130732.GA28950@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-07/txt/msg00133.txt.bz2 On Fri, Jun 23, 2006 at 03:07:32PM +0200, Jan Kratochvil wrote: > 2006-06-23 Jan Kratochvil > > * dwarf2read.c (dwarf2_symbol_mark_computed): Fixed later crash > on location list reference if the ".debug_loc" section is missing. I've committed this very similar patch (clearer comment). Thanks! -- Daniel Jacobowitz CodeSourcery 2006-07-12 Daniel Jacobowitz * dwarf2read.c (dwarf2_symbol_mark_computed): Handle corrupted or missing location list information. Suggested by Jan Kratochvil . 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 12 Jul 2006 21:13:13 -0000 @@ -9324,7 +9324,11 @@ 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) + /* ".debug_loc" may not exist at all, or the offset may be outside + the section. If so, fall through to the complaint in the + other branch. */ + && DW_UNSND (attr) < dwarf2_per_objfile->loc_size) { struct dwarf2_loclist_baton *baton;