From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7773 invoked by alias); 11 Jul 2007 20:30:58 -0000 Received: (qmail 7765 invoked by uid 22791); 11 Jul 2007 20:30:57 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 11 Jul 2007 20:30:50 +0000 Received: (qmail 13847 invoked from network); 11 Jul 2007 20:30:48 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 11 Jul 2007 20:30:48 -0000 To: gdb-patches@sourceware.org Subject: Re: [rfc] Detect dwarf address size mismatch References: <20070711141912.GA12298@caradoc.them.org> <20070711194141.GA28114@caradoc.them.org> From: Jim Blandy Date: Wed, 11 Jul 2007 20:30:00 -0000 In-Reply-To: <20070711194141.GA28114@caradoc.them.org> (Daniel Jacobowitz's message of "Wed, 11 Jul 2007 15:41:41 -0400") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/msg00179.txt.bz2 Daniel Jacobowitz writes: > On Wed, Jul 11, 2007 at 12:27:29PM -0700, Jim Blandy wrote: >> Would it make sense to move the check after the extended_op switch >> altogether, and always use extended_len to advance line_ptr? This >> would make GDB more robust against new extended opcodes. > > I thought about it; it might make sense to do this in the default > case, but not in any of the handled cases, since they need to advance > line_ptr anyway to read multiple items. True. But I think the check should go after the switch in any case; there's no reason to only apply sanity checking to that one opcode. But then as long as one's doing that check across all the extended opcodes, one has the information needed to insulate the surrounding code from the individual cases' vaguaries. The first point seems like a definite should-do, unless I'm missing something; the second one I agree is less clear-cut.