From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32679 invoked by alias); 20 Sep 2002 15:11:49 -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 32671 invoked from network); 20 Sep 2002 15:11:43 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 20 Sep 2002 15:11:43 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id EAE503CF9; Fri, 20 Sep 2002 11:11:40 -0400 (EDT) Message-ID: <3D8B3AAC.3080906@ges.redhat.com> Date: Fri, 20 Sep 2002 08:11:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020824 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Buettner Cc: gdb@sources.redhat.com Subject: Re: [rfc] Add per frame frame_saved_pc() References: <3D8A9662.1080902@ges.redhat.com> <1020920072452.ZM24099@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00311.txt.bz2 > On Sep 19, 11:30pm, Andrew Cagney wrote: > > >> Back to (trumpet noises) CFI and more fall-out from the MIPS and generic >> dummy frames. >> >> - The CFI doco describes a ``return_address_register'' which ``[...] >> might not correspond to a machine register''. This means a CFI specific >> frame saved PC method. > > > I'm not certain that this should (necessarily) drive our decisions. There are currently three (er 4) frame_saved_pc() functions: frame_saved_pc(dummy) frame_saved_pc(CFI) frame_saved_pc(``old style with frame init saved regs'') frame_saved_pc(NULL) === read_pc() (but only sort of) >> - Given a generic dummy frame, it knows exactly where the callers frame >> PC is. No need to ask the target code. >> >> With this in mind, I'd like to propose making frame_saved_pc() a >> per-frame method. > > > I'd be willing to look at a patch. In particular, what I'm curious > about it to see the places where the frame_saved_pc field is > initialized in the frame. I can picture how the generic dummy > frame code would look, but what I'm less clear about is what it'd > look like for normal frames. It seems to me that you have two choices, > 1) have a generic method which falls back on the current machinery, or > 2) have architecture specific methods. I'm more interested in how (2) > will be accomplished. If I get the code right, I won't be changing any targets :-^ The target frame_saved_pc() code would, simply, not be called in certain cases. It would be handled the same way as the unwind code - See set_unwind_by_pc(). Andrew