From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21260 invoked by alias); 11 Jan 2007 16:34:40 -0000 Received: (qmail 21248 invoked by uid 22791); 11 Jan 2007 16:34:39 -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; Thu, 11 Jan 2007 16:34:27 +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 41C2E21663 for ; Thu, 11 Jan 2007 17:34:24 +0100 (CET) From: Andreas Schwab To: gdb-patches@sourceware.org Subject: Re: [rfc, frame] Always check for unsaved PC References: <20060819161139.GC25238@nevyn.them.org> <200608201427.k7KERnD0001824@elgar.sibelius.xs4all.nl> <20061110201548.GA1115@nevyn.them.org> X-Yow: It's 74 degrees, 12 minutes NORTH, and 41 degrees, 3 minutes EAST!! Soon, it will be TUESDAY!! Date: Thu, 11 Jan 2007 16:34:00 -0000 In-Reply-To: <20061110201548.GA1115@nevyn.them.org> (Daniel Jacobowitz's message of "Fri, 10 Nov 2006 15:15:48 -0500") Message-ID: User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.91 (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: 2007-01/txt/msg00300.txt.bz2 Daniel Jacobowitz writes: > @@ -1111,6 +1141,42 @@ get_prev_frame_1 (struct frame_info *thi > return NULL; > } > > + /* Check that this and the next frame do not unwind the PC register > + to the same memory location. If they do, then even though they > + have different frame IDs, the new frame will be bogus; two > + functions can't share a register save slot for the PC. This can > + happen when the prologue analyzer finds a stack adjustment, but > + no PC save. This check does assume that the "PC register" is > + roughly a traditional PC, even if the gdbarch_unwind_pc method > + frobs it. */ > + if (this_frame->level > 0 > + && get_frame_type (this_frame) == NORMAL_FRAME > + && get_frame_type (this_frame->next) == NORMAL_FRAME) > + { > + int optimized, realnum; > + enum lval_type lval, nlval; > + CORE_ADDR addr, naddr; > + > + frame_register_unwind_location (this_frame, PC_REGNUM, &optimized, > + &lval, &addr, &realnum); > + frame_register_unwind_location (get_next_frame (this_frame), PC_REGNUM, > + &optimized, &nlval, &naddr, &realnum); > + This is broken. You can't use PC_REGNUM unconditionally without checking whether that register actually exists. The ia64 does not have such a register. Andreas. -- 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."