From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Received: (qmail 3221 invoked from network); 10 Jan 2003 20:10:46 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by 209.249.29.67 with SMTP; 10 Jan 2003 20:10:46 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id BA7FC3E02; Fri, 10 Jan 2003 15:10:35 -0500 (EST) Message-ID: <3E1F28BB.9080704@redhat.com> Date: Fri, 10 Jan 2003 20:10:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.1) Gecko/20021211 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: RFC: Mostly kill FRAME_CHAIN_VALID, add user knob References: <20021226191541.GA8483@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-01/txt/msg00407.txt.bz2 FYI, on the unwind branch, I'm adding the below to get_prev_frame() /* There is always a frame. If this assertion fails, suspect that something should be calling get_selected_frame() or get_current_frame(). */ gdb_assert (next_frame != NULL); if (next_frame->level >= 0 /* && !backtrace_below_main */ && inside_main_func (next_frame->pc)) /* Don't unwind past main(), always unwind the sentinel frame. Note, this is done _before_ the frame has been marked as previously unwound. That way if the user later decides to allow unwinds past main(), it can just happen. */ return 0; /* Only try to do the unwind once. */ if (next_frame->prev_p) return next_frame->prev; next_frame->prev_p = 1; Should eliminate that need to flush the frame cache everytime that command is issued (should be able to merge it into current code as well). Looking at the other checks: /* If we're already inside the entry function for the main objfile, then it isn't valid. */ if (inside_entry_func (get_frame_pc (fi))) return 0; I'd better add that one as well (but, I think, after ->prev_p). Note that this and the test below do the same thing, so only one is needed. It is just that one stops things a frame later. /* If we're inside the entry file, it isn't valid. */ /* NOTE/drow 2002-12-25: should there be a way to disable this check? it assumes a single small entry file, and the way some debug readers (e.g. dbxread) figure out which object is the entry file is somewhat hokey. */ if (inside_entry_file (frame_pc_unwind (fi))) return 0; Should this one be dropped? If the user specified unwind past main, then they problably want _start() included in the backtrace. It's presence also makes the other inside_entry_file() test redundant. Andrew PS: The command/variable should be `backtrace-*above*-main', or perhaphs `backtrace-before-main' (before ~= prev).