From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16076 invoked by alias); 22 Nov 2003 13:47:54 -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 16067 invoked from network); 22 Nov 2003 13:47:51 -0000 Received: from unknown (HELO localhost.redhat.com) (65.49.0.121) by sources.redhat.com with SMTP; 22 Nov 2003 13:47:51 -0000 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 2A0F12B8F; Sat, 22 Nov 2003 08:47:43 -0500 (EST) Message-ID: <3FBF68FE.8070409@gnu.org> Date: Sat, 22 Nov 2003 13:47:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] inside_entry_func() related changes References: <1031122000931.ZM22440@localhost.localdomain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-11/txt/msg00462.txt.bz2 > This patch changes the implementation of inside_entry_func() so that > the entry_func_{low,high}pc fields are not used. > > It also enables the inside_entry_func() test within frame.c because > I need this to work for FR-V. (Note that a previous patch removed > the inside_entry_func() call from frv-tdep.c.) Kevin, Re my comment: > - /* NOTE: cagney/2003-02-25: Don't enable until someone has found > - hard evidence that this is needed. */ The revised patch I posted: http://sources.redhat.com/ml/gdb-patches/2003-11/msg00441.html contains the test: - && inside_entry_func (get_frame_pc (this_frame))) +#if 0 + && get_frame_func (this_frame) == entry_point_address () +#endif (be it in a one line function or inline, what ever) while the patch you've proposed also introduces the additional checks: > if (pc == 0) > return 1; and: > if (CALL_DUMMY_LOCATION == AT_ENTRY_POINT) > { > /* Do not stop backtracing if the pc is in the call dummy > at the entry point. */ > /* FIXME: Won't always work with zeros for the last two arguments */ > if (DEPRECATED_PC_IN_CALL_DUMMY (pc, 0, 0)) > return 0; > } Rather than doing this (I assume that your frv test doesn't provide evidence supporting their introduction and this was unintentional), why not add a one-line function containing just the minimal test and then call that from get_prev_frame? Note that, per MarkK's comment: /* 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(). */ so a test based on get_frame_pc won't work. Also a call to entry_point_address() is preferable to to a reference to the global variable. Daniel mentioned the doco, what about a testcase for just this? > (gdb) bt > #0 factorial (value=5) > at /ocotillo2/devo-frv/frv-elf/bld/../../devo/gdb/testsuite/gdb.base/break.c:96 > #1 0x00010574 in factorial (value=6) > at /ocotillo2/devo-frv/frv-elf/bld/../../devo/gdb/testsuite/gdb.base/break.c:97 > #2 0x000104c0 in main (argc=0, argv=0x0, envp=0x0) > at /ocotillo2/devo-frv/frv-elf/bld/../../devo/gdb/testsuite/gdb.base/break.c:79 > (gdb) set backtrace past-main > (gdb) bt > #0 factorial (value=5) > at /ocotillo2/devo-frv/frv-elf/bld/../../devo/gdb/testsuite/gdb.base/break.c:96 > #1 0x00010574 in factorial (value=6) > at /ocotillo2/devo-frv/frv-elf/bld/../../devo/gdb/testsuite/gdb.base/break.c:97 > #2 0x000104c0 in main (argc=0, argv=0x0, envp=0x0) > at /ocotillo2/devo-frv/frv-elf/bld/../../devo/gdb/testsuite/gdb.base/break.c:79 > #3 0x00010118 in _start () Andrew