From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1392 invoked by alias); 24 Sep 2008 13:00:57 -0000 Received: (qmail 1376 invoked by uid 22791); 24 Sep 2008 13:00:56 -0000 X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 24 Sep 2008 13:00:17 +0000 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 561B845D36; Wed, 24 Sep 2008 15:00:14 +0200 (CEST) From: Andreas Schwab To: Andrew Stubbs Cc: gdb@sourceware.org, gdb-patches@sourceware.org Subject: Re: [commited] Detect bad debug info References: <48D3EC6C.8050809@codesourcery.com> X-Yow: I'll eat ANYTHING that's BRIGHT BLUE!! Date: Wed, 24 Sep 2008 13:00:00 -0000 In-Reply-To: (Andreas Schwab's message of "Wed, 24 Sep 2008 14:17:45 +0200") Message-ID: User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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: 2008-09/txt/msg00488.txt.bz2 Andreas Schwab writes: > Andrew Stubbs writes: > >> + /* Detect bad debug info. */ >> + maxsize = -offset; >> + for (i = regnum; i < gdbarch_num_regs (gdbarch); i++) > > This is broken, it completely ignores the pseudo regs, which badly > breaks ia64 and many other targets. Committed as obvious. > > Andreas. > > 2008-09-24 Andreas Schwab > > * frame.c (get_frame_register_bytes): Take pseudo registers into > account. Also checked this in to avoid useless function calls. Andreas. --- ChangeLog.~1.9844.~ 2008-09-24 14:15:35.000000000 +0200 +++ ChangeLog 2008-09-24 14:54:30.000000000 +0200 @@ -1,7 +1,7 @@ 2008-09-24 Andreas Schwab * frame.c (get_frame_register_bytes): Take pseudo registers into - account. + account. Avoid excessive function calls. 2008-09-23 Doug Evans --- frame.c.~1.254.~ 2008-09-24 14:09:33.000000000 +0200 +++ frame.c 2008-09-24 14:53:45.000000000 +0200 @@ -798,6 +798,7 @@ get_frame_register_bytes (struct frame_i struct gdbarch *gdbarch = get_frame_arch (frame); int i; int maxsize; + int numregs; /* Skip registers wholly inside of OFFSET. */ while (offset >= register_size (gdbarch, regnum)) @@ -809,8 +810,8 @@ get_frame_register_bytes (struct frame_i /* Ensure that we will not read beyond the end of the register file. This can only ever happen if the debug information is bad. */ maxsize = -offset; - for (i = regnum; - i < gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch); i++) + numregs = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch); + for (i = regnum; i < numregs; i++) { int thissize = register_size (gdbarch, i); if (thissize == 0) -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."