From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5979 invoked by alias); 28 Sep 2005 17:10:16 -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 5961 invoked by uid 22791); 28 Sep 2005 17:10:07 -0000 Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 28 Sep 2005 17:10:07 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j8SHA6DL009452 for ; Wed, 28 Sep 2005 13:10:06 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j8SHA6V25893 for ; Wed, 28 Sep 2005 13:10:06 -0400 Received: from localhost.localdomain (vpn50-14.rdu.redhat.com [172.16.50.14]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id j8SHA5H9008488 for ; Wed, 28 Sep 2005 13:10:05 -0400 Received: from ironwood.lan (ironwood.lan [192.168.64.8]) by localhost.localdomain (8.12.11/8.12.10) with ESMTP id j8SHA0AU023145 for ; Wed, 28 Sep 2005 10:10:00 -0700 Date: Wed, 28 Sep 2005 17:10:00 -0000 From: Kevin Buettner To: gdb-patches@sources.redhat.com Subject: Re: RFC: Make PowerPC backtraces more robust Message-ID: <20050928101000.0038099a@ironwood.lan> In-Reply-To: <20050923193403.GA7146@nevyn.them.org> References: <20050923193403.GA7146@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2005-09/txt/msg00279.txt.bz2 On Fri, 23 Sep 2005 15:34:03 -0400 Daniel Jacobowitz wrote: > Index: rs6000-tdep.c > =================================================================== > RCS file: /big/fsf/rsync/src/src/gdb/rs6000-tdep.c,v > retrieving revision 1.243 > diff -u -p -r1.243 rs6000-tdep.c > --- rs6000-tdep.c 19 Sep 2005 17:38:03 -0000 1.243 > +++ rs6000-tdep.c 23 Sep 2005 18:26:39 -0000 > @@ -2852,6 +2852,7 @@ rs6000_frame_cache (struct frame_info *n > struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > struct rs6000_framedata fdata; > int wordsize = tdep->wordsize; > + CORE_ADDR func, pc; > > if ((*this_cache) != NULL) > return (*this_cache); > @@ -2859,35 +2860,56 @@ rs6000_frame_cache (struct frame_info *n > (*this_cache) = cache; > cache->saved_regs = trad_frame_alloc_saved_regs (next_frame); > > - skip_prologue (frame_func_unwind (next_frame), frame_pc_unwind (next_frame), > - &fdata); > + func = frame_func_unwind (next_frame); > + pc = frame_pc_unwind (next_frame); > + skip_prologue (func, pc, &fdata); > + > + /* Figure out the parent's stack pointer. */ > + > + /* NOTE: cagney/2002-04-14: The ->frame points to the inner-most > + address of the current frame. Things might be easier if the > + ->frame pointed to the outer-most address of the frame. In > + the mean time, the address of the prev frame is used as the > + base address of this frame. */ > + cache->base = frame_unwind_register_unsigned (next_frame, SP_REGNUM); > + > + /* If the function appears to be frameless, check a couple of likely > + indicators that we have simply failed to find the frame setup. > + Two common cases of this are missing symbols (i.e. > + frame_func_unwind returns the wrong address or 0), and assembly > + stubs which have a fast exit path but set up a frame on the slow > + path. > + > + If the LR appears to return to this function, then presume that > + we have an ABI compliant frame that we failed to find. */ > + if (fdata.frameless && fdata.lr_offset == 0) > + { > + CORE_ADDR saved_lr; > + int make_frame = 0; > + > + func = frame_func_unwind (next_frame); It appears to me that func has already been computed earlier in this function and that the value should be the same. The rest looks okay to me. Kevin