From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18981 invoked by alias); 5 Apr 2003 03:56:47 -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 18972 invoked from network); 5 Apr 2003 03:56:41 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.166.107) by sources.redhat.com with SMTP; 5 Apr 2003 03:56:41 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id B8B2B2B23; Fri, 4 Apr 2003 22:56:27 -0500 (EST) Message-ID: <3E8E53EB.4030201@redhat.com> Date: Sat, 05 Apr 2003 03:56:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [patch rfc] Add the frame's type to the unwinder References: <3E8B5905.1000704@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg00074.txt.bz2 > Hello, > > The attached patch, moves the frame's type into `struct frame_unwind' and in doing so makes it possible to combine the sequence: > > prev->type = frame_type_from_pc() > prev->unwind = frame_unwind_find_by_pc() > > into a single: > > prev->unwind = frame_unwind_find_by_pc(); > // prev->type == prev->unwind->type; > > and hence eliminate the the call to frame_type_from_pc(). > > > Fine print: > > While the above is true for new code, old code continues to use the same confused combination of frame_type_from_pc(), frame_unwind_find_by_pc(), deprecated_set_frame_type(), and legacy_get_prev_frame(). A legacy frame's type is initialized to UNKNOWN_FRAME, and then zero or more of those functions will override it. get_frame_type() mapping an UNKNOWN_FRAME onto a NORMAL_FRAME. > > Importantly, if a legacy frame's unwinder returns a known frame type (!UNKNOWN_FRAME) then that will be used in preference to any other value. This should make it possible for old architectures to incrementally implement new unwinders. > > > Tested on d10v, ppc, and i386. I'll commit in a few days, I've checked this in. Andrew > 2003-04-02 Andrew Cagney > > * frame.c (get_prev_frame): Do not call frame_type_from_pc. Set > the frame's type from the unwinder. > (get_frame_type): Map UNKNOWN_FRAME onto NORMAL_FRAME. > (create_new_frame, legacy_get_prev_frame): When the unwinder's > type isn't UNKNOWN_FRAME, initalize "type" from the unwinder. > (get_frame_base_address): Use get_frame_type. > (get_frame_locals_address, get_frame_args_address): Ditto. > (legacy_saved_regs_unwinder): Set the type to UNKNOWN_TYPE. > * frame.h (enum frame_type): Add UNKNOWN_FRAME. > (struct frame_info): Add comment explaining why the frame contains > a "type" field. > * dummy-frame.c (dummy_frame_unwind): Set the type to DUMMY_FRAME. > * d10v-tdep.c (d10v_frame_unwind): Set the type to NORMAL_FRAME. > * sentinel-frame.c (sentinel_frame_unwinder): Set the type to > NORMAL_FRAME. > * frame-unwind.h: Include "frame.h". > (struct frame_unwind): Add "type" field. > * Makefile.in (frame_unwind_h): Add $(frame_h). > > Inde