From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18525 invoked by alias); 19 Nov 2003 17:36:03 -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 18515 invoked from network); 19 Nov 2003 17:35:59 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 19 Nov 2003 17:35:59 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id hAJHZpp6000253; Wed, 19 Nov 2003 18:35:51 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id hAJHZpEr000503; Wed, 19 Nov 2003 18:35:51 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id hAJHZpkh000500; Wed, 19 Nov 2003 18:35:51 +0100 (CET) Date: Wed, 19 Nov 2003 17:36:00 -0000 Message-Id: <200311191735.hAJHZpkh000500@elgar.kettenis.dyndns.org> From: Mark Kettenis To: cagney@gnu.org CC: gdb-patches@sources.redhat.com In-reply-to: <3FB94B63.7000906@gnu.org> (message from Andrew Cagney on Mon, 17 Nov 2003 17:27:47 -0500) Subject: Re: [RFA] Fix backtrace/1435 References: <200311172135.hAHLZl0n009190@elgar.kettenis.dyndns.org> <3FB94B63.7000906@gnu.org> X-SW-Source: 2003-11/txt/msg00395.txt.bz2 Date: Mon, 17 Nov 2003 17:27:47 -0500 From: Andrew Cagney > Ok to check this in? Yes, but with more comments :-) Here's what I actually checked in. Mark Index: ChangeLog from Mark Kettenis * frame.c (get_prev_frame): Use result from get_frame_address_in_block instead of get_frame_pc as argument to inside_main_func. Fixes PR backtrace/1435. Index: frame.c =================================================================== RCS file: /cvs/src/src/gdb/frame.c,v retrieving revision 1.147 diff -u -p -r1.147 frame.c --- frame.c 24 Oct 2003 17:37:03 -0000 1.147 +++ frame.c 19 Nov 2003 17:34:38 -0000 @@ -1790,9 +1790,13 @@ get_prev_frame (struct frame_info *this_ get_current_frame(). */ gdb_assert (this_frame != NULL); + /* Make sure we pass an address within THIS_FRAME's code block to + inside_main_func. Otherwise, we might stop unwinding at a + function which has a call instruction as its last instruction if + that function immediately precedes main(). */ if (this_frame->level >= 0 && !backtrace_past_main - && inside_main_func (get_frame_pc (this_frame))) + && inside_main_func (get_frame_address_in_block (this_frame))) /* Don't unwind past main(), bug 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