From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7924 invoked by alias); 17 Nov 2003 21:35:56 -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 7901 invoked from network); 17 Nov 2003 21:35:53 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 17 Nov 2003 21:35:53 -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 hAHLZmxT000328 for ; Mon, 17 Nov 2003 22:35:48 +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 hAHLZmFa009193 for ; Mon, 17 Nov 2003 22:35:48 +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 hAHLZl0n009190; Mon, 17 Nov 2003 22:35:47 +0100 (CET) Date: Mon, 17 Nov 2003 21:35:00 -0000 Message-Id: <200311172135.hAHLZl0n009190@elgar.kettenis.dyndns.org> From: Mark Kettenis To: gdb-patches@sources.redhat.com Subject: [RFA] Fix backtrace/1435 X-SW-Source: 2003-11/txt/msg00362.txt.bz2 This patch fixes backtrace/1435. The failure occurs when main immediately follows a function (say foo) which has its epilogue optimized out by the compiler. In that case the backtrace will be terminated prematurely since get_frame_pc on foo's frame will return the address of the first instruction of main. This can be fixed by using get_frame_address_in_block. Ok to check this 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. 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 17 Nov 2003 21:02:40 -0000 @@ -1792,7 +1792,7 @@ get_prev_frame (struct frame_info *this_ 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