From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15735 invoked by alias); 8 Jun 2004 15:47:03 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 15536 invoked from network); 8 Jun 2004 15:46:46 -0000 Received: from unknown (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sourceware.org with SMTP; 8 Jun 2004 15:46:46 -0000 Received: from hiauly1.hia.nrc.ca (hiauly1.hia.nrc.ca [127.0.0.1] (may be forged)) by hiauly1.hia.nrc.ca (8.12.9-20030917/8.12.9) with ESMTP id i58FkiCp006693; Tue, 8 Jun 2004 11:46:45 -0400 (EDT) Received: (from dave@localhost) by hiauly1.hia.nrc.ca (8.12.9-20030917/8.12.9/Submit) id i58Fkiir006691; Tue, 8 Jun 2004 11:46:44 -0400 (EDT) Message-Id: <200406081546.i58Fkiir006691@hiauly1.hia.nrc.ca> Subject: Re: [patch/rfa] Fix some corner cases in hppa stack unwinding To: gdb-patches@gcc.gnu.org Date: Tue, 08 Jun 2004 15:47:00 -0000 From: "John David Anglin" Cc: randolph@tausq.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2004-06/txt/msg00156.txt.bz2 > p.s. it's probably possible to come up with a tricky test case where the > unwinder will still break: > > frame 0: sets/saves frame pointer, start unwinding after fp is set but > before it is saved > frame 1 .. n-1: does not set/save frame pointer > frame n: requires frame pointer to unwind properly (e.g. calls alloca()) > frame n+1 ... > > in this case frame n will not unwind properly because we cannot retrieve > the correct fp from the stack (the one that has not yet been saved). Under HP-UX when a frame pointer is needed, GCC 3.3 and later saves the previous stack pointer (frame pointer) in the frame marker at sp - (TARGET_64BIT ? -8 : -4). This value is copied in dynamic stack allocations. Thus, you should be able to obtain the frame pointer for frame 'n' from the frame marker. You just need the address of frame n-1 to access the frame marker of frame n. This could also be done under linux if it is useful. Dave -- J. David Anglin dave.anglin@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602)