From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14792 invoked by alias); 6 Dec 2004 03:27:32 -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 14779 invoked from network); 6 Dec 2004 03:27:29 -0000 Received: from unknown (HELO arwen.tausq.org) (64.81.244.109) by sourceware.org with SMTP; 6 Dec 2004 03:27:29 -0000 Received: by arwen.tausq.org (Postfix, from userid 1000) id 98886111F48; Sun, 5 Dec 2004 19:27:26 -0800 (PST) Date: Mon, 06 Dec 2004 03:31:00 -0000 From: Randolph Chung To: gdb-patches@sources.redhat.com Subject: [patch/rfa] allow unwinding "past main" for dummy frames Message-ID: <20041206032726.GB6359@tausq.org> Reply-To: Randolph Chung Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-GPG: for GPG key, see http://www.tausq.org/gpg.txt User-Agent: Mutt/1.5.6+20040722i X-SW-Source: 2004-12/txt/msg00147.txt.bz2 On hpux, we push a small bit of code on the stack to implement function calls from gdb. The stack trampoline contains a return address that points back to the current function. this is needed to properly restore the space registers (see hppa_hpux_push_dummy_code in hppa-hpux-tdep.c for a much more detailed explanation). The upshot of all of this is that when we do a backtrace from a gdb-called function, a backtrace can be prematurely truncated at a dummy frame. Since it doesn't make sense anyway to stop unwinding at dummy frames, this patch skips the "main function" detection logic for dummy frames. The same logic is already there for checking against the entry function a bit farther down in get_prev_frame (). ok? randolph 2004-12-05 Randolph Chung * frame.c (get_prev_frame): Don't terminate unwinding at main if we are unwinding through a dummy frame. Index: frame.c =================================================================== RCS file: /cvs/src/src/gdb/frame.c,v retrieving revision 1.195 diff -u -p -r1.195 frame.c --- frame.c 10 Nov 2004 23:26:33 -0000 1.195 +++ frame.c 6 Dec 2004 03:19:46 -0000 @@ -1200,6 +1200,7 @@ get_prev_frame (struct frame_info *this_ gdb_assert (this_frame != NULL); if (this_frame->level >= 0 + && get_frame_type (this_frame) != DUMMY_FRAME && !backtrace_past_main && inside_main_func (this_frame)) /* Don't unwind past main(). Note, this is done _before_ the -- Randolph Chung Debian GNU/Linux Developer, hppa/ia64 ports http://www.tausq.org/