From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23726 invoked by alias); 1 Aug 2005 13:12:11 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 23699 invoked by uid 22791); 1 Aug 2005 13:12:06 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 01 Aug 2005 13:12:06 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1Dza5L-0001Aq-Ll; Mon, 01 Aug 2005 09:12:03 -0400 Date: Mon, 01 Aug 2005 13:12:00 -0000 From: Daniel Jacobowitz To: Stefan =?iso-8859-1?Q?Burstr=F6m?= Cc: gdb@sources.redhat.com Subject: Re: rs6000 / ppc backend in gdb Message-ID: <20050801131203.GA4405@nevyn.them.org> Mail-Followup-To: Stefan =?iso-8859-1?Q?Burstr=F6m?= , gdb@sources.redhat.com References: <20050731011738.GA13782@nevyn.them.org> <33e11968721.41b5c8f4@mail.m.bonet.se> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <33e11968721.41b5c8f4@mail.m.bonet.se> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-08/txt/msg00001.txt.bz2 On Sun, Jul 31, 2005 at 11:02:36PM +0100, Stefan Burström wrote: > Clearly, this is a limitation in the ppc backend of gdb. I have reached as > far as I understand that the skip_prologue function is responsible for > figuring out the stack frame of the function. However, why is this needed? > How come gdb does all this? Isn't the position of lr and prev_sp well > defined in the stack frame? No, absolutely they aren't! We've learned, over years of debugging people's real code, that trusting the architecture defined stack layout is not a good choice. For instance, on x86 -fomit-frame-pointer is popular to free up an additional register. You weren't very specific about what versions you were testing, but on x86 you've probably got DWARF2 CFI available, which allows reliable unwinding without prologue analysis. On PPC we don't support DWARF2 CFI yet; until recently, GCC wrote out buggered CFI in which LR and another register had the same register number. That's been fixed, but to turn on PPC CFI support we'd need to detect and work around it, and no one's implemented that yet. -- Daniel Jacobowitz CodeSourcery, LLC