From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18104 invoked by alias); 24 Jul 2007 17:14:58 -0000 Received: (qmail 18096 invoked by uid 22791); 24 Jul 2007 17:14:57 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 24 Jul 2007 17:14:55 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 9AB9B982CF; Tue, 24 Jul 2007 17:14:54 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 5CACD982BA; Tue, 24 Jul 2007 17:14:54 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1IDNyG-0004CK-9i; Tue, 24 Jul 2007 13:14:52 -0400 Date: Tue, 24 Jul 2007 17:17:00 -0000 From: Daniel Jacobowitz To: Michael Eager Cc: gdb@sources.redhat.com, Vladimir Prus Subject: Re: frame cache Message-ID: <20070724171452.GA15843@caradoc.them.org> Mail-Followup-To: Michael Eager , gdb@sources.redhat.com, Vladimir Prus References: <46A63051.7060208@eagercon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46A63051.7060208@eagercon.com> User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-07/txt/msg00172.txt.bz2 On Tue, Jul 24, 2007 at 10:01:05AM -0700, Michael Eager wrote: > I have a couple questions about the _frame_cache > structure and functions. > > 1) This appears to be a single-entry cache. Why not keep > multiple entries? No, it isn't single-entry. The common code in frame.c is responsible for passing a pointer to the correct place to store the cache for the current frame. > 2) The data in the frame cache seems to be of two different > types: > a) Fixed, based on analyzing the code: register offsets, > stack alignment, framelessness, etc. > b) Variable, based on the call: return pc, frame base > > It looks to me that the object code is analyzed repeatedly > and this fixed information is discarded along with the > variable information. > > Why not keep a persistent cache of function specific fixed > data and only discard the call-specific data when the frame > cache is cleared? No good reason. I have thought about doing this before. It's not fundamentally different from the way the DWARF unwinder works; the persistent part of the cache would be approximately an FDE. It's a little tricky to implement, since we still need to detect stopping within the prologue, but not too tricky. I suppose bonus points would be awarded for constructing an actual FDE :-) > Is there any documentation about what target-specific data > the frame cache is supposed to contain or how the functions are > supposed to work? Not really, because it's completely up to the target what goes in them; it varies quite a bit between targets. Vlad, didn't you say a week or two ago that you'd been working on some frame docs? -- Daniel Jacobowitz CodeSourcery