From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17181 invoked by alias); 17 Jul 2007 13:21:19 -0000 Received: (qmail 17167 invoked by uid 22791); 17 Jul 2007 13:21:17 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 17 Jul 2007 13:21:13 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 42675982C3; Tue, 17 Jul 2007 13:21:12 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id B11C9982A3; Tue, 17 Jul 2007 13:21:11 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1IAmzF-00056r-Ie; Tue, 17 Jul 2007 09:21:09 -0400 Date: Tue, 17 Jul 2007 13:55:00 -0000 From: Daniel Jacobowitz To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: [rfc] Detect dwarf address size mismatch Message-ID: <20070717132109.GA19362@caradoc.them.org> Mail-Followup-To: Mark Kettenis , gdb-patches@sourceware.org References: <20070711141912.GA12298@caradoc.them.org> <20070711194141.GA28114@caradoc.them.org> <20070717124711.GA27936@caradoc.them.org> <200707171301.l6HD146D020081@brahms.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200707171301.l6HD146D020081@brahms.sibelius.xs4all.nl> User-Agent: Mutt/1.5.15 (2007-04-09) 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: 2007-07/txt/msg00219.txt.bz2 On Tue, Jul 17, 2007 at 03:01:04PM +0200, Mark Kettenis wrote: > > > @@ -6792,6 +6793,15 @@ dwarf_decode_lines (struct line_header * > > _("mangled .debug_line section")); > > return; > > } > > + /* Make sure that we parsed the extended op correctly. If e.g. > > + we expected a different address size than the producer used, > > + we may have read the wrong number of bytes. */ > > + if (line_ptr != extended_end) > > + { > > + complaint (&symfile_complaints, > > + _("mangled .debug_line section")); > > + return; > > + } > > break; > > case DW_LNS_copy: > > if (lh->num_file_names < file) > > The complaint "mangled .debug_line section" seems a bit unhelpful to > me, especially since there are now two identical messages for what > appears to be somewhat different conditions. Any chance of changing > it something more distinguishable? It was my mistake, not yours, that you didn't notice it before. It used to say "bad address size", but Jim suggested I check all extended ops instead of just DW_LNE_set_address. So the more specific complaint is no longer accurate. How about changing the first one to "unrecognized extended opcode in .debug_line", and the second one to "mangled extended opcode in .debug_line"? I thought about making the unrecognized opcode case more lenient, and using break instead of return, since we can advance line_ptr the right amount. But I think we can't skip unrecognized line opcodes the way we can skip unrecognized attributes; if the opcode changes the PC, then the next advance_pc opcode will start from the wrong place, et cetera. -- Daniel Jacobowitz CodeSourcery