From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6367 invoked by alias); 31 Mar 2002 05:56:18 -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 6360 invoked from network); 31 Mar 2002 05:56:16 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 31 Mar 2002 05:56:16 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 16rYKC-0006LQ-00; Sun, 31 Mar 2002 00:56:20 -0500 Date: Sat, 30 Mar 2002 21:56:00 -0000 From: Daniel Jacobowitz To: Jim Blandy Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: Recognize bottom of stack on Linux Message-ID: <20020331005620.A23217@nevyn.them.org> Mail-Followup-To: Jim Blandy , gdb-patches@sources.redhat.com References: <200202040206.VAA21952@zenia.red-bean.com> <20020203222111.A17644@nevyn.them.org> <20020205165716.A10437@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23i X-SW-Source: 2002-03/txt/msg00624.txt.bz2 On Wed, Feb 06, 2002 at 02:26:00PM -0500, Jim Blandy wrote: > > Daniel Jacobowitz writes: > > I like this. The way func_frame_chain_valid should really be used is > > by something like: > > > > /* NOTE: tm-i386nw.h and tm-i386v4.h override this. */ > > set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid); > > > > (copied from i386-tdep.c). > > > > Does this patch work for you? > > Yes, thanks. I've included a revised version of my patch below. > > > I'm curious as to why we can't just set this universally, or at least a > > little more globally. Most things that have a main () use it as a > > normal main (). I'd propose that we set it as the default frame chain, > > and provide/document an option to ignore inside_main_func. > > Well, gdbarch is never supposed to change the default behavior of > macros; this helps us convert pre-gdbarch targets incrementally. > Simply turning on gdbarch for one's target ideally wouldn't change its > behavior at all. Ping - this patch seems to have fallen through the cracks. It fixes eight of the twenty remaining testsuite failures on my configuration, so I'd like to see it committed. > > > 2002-02-06 Jim Blandy > > Fix from Daniel Jacobowitz: > * config/i386/tm-linux.h (FRAME_CHAIN_VALID): Use > `func_frame_chain_valid' for this. > * i386-tdep.c (i386_gdbarch_init): Note that tm-linux.h is > overriding the selection we make here. > > Index: gdb/i386-tdep.c > =================================================================== > RCS file: /cvs/src/src/gdb/i386-tdep.c,v > retrieving revision 1.50 > diff -c -r1.50 i386-tdep.c > *** gdb/i386-tdep.c 2002/01/01 16:29:43 1.50 > --- gdb/i386-tdep.c 2002/02/06 19:19:27 > *************** > *** 1324,1330 **** > > set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack); > > ! /* NOTE: tm-i386nw.h and tm-i386v4.h override this. */ > set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid); > > /* NOTE: tm-i386aix.h, tm-i386bsd.h, tm-i386os9k.h, tm-linux.h, > --- 1324,1330 ---- > > set_gdbarch_pc_in_call_dummy (gdbarch, pc_in_call_dummy_on_stack); > > ! /* NOTE: tm-i386nw.h, tm-i386v4.h, and tm-linux.h override this. */ > set_gdbarch_frame_chain_valid (gdbarch, file_frame_chain_valid); > > /* NOTE: tm-i386aix.h, tm-i386bsd.h, tm-i386os9k.h, tm-linux.h, > Index: gdb/config/i386/tm-linux.h > =================================================================== > RCS file: /cvs/src/src/gdb/config/i386/tm-linux.h,v > retrieving revision 1.16 > diff -c -r1.16 tm-linux.h > *** gdb/config/i386/tm-linux.h 2001/11/08 00:03:52 1.16 > --- gdb/config/i386/tm-linux.h 2002/02/06 19:19:28 > *************** > *** 82,87 **** > --- 82,98 ---- > #define IN_SIGTRAMP(pc, name) i386_linux_in_sigtramp (pc, name) > extern int i386_linux_in_sigtramp (CORE_ADDR, char *); > > + /* On Linux, the entry point is called _start, but that invokes > + something called __libc_start_main, which calls main. So if we > + want the stack to end at main (as it does for most GDB targets), > + it's not enough for us to use inside_entry_func or > + inside_entry_file; that rule will only trigger after we've included > + __libc_start_main in the backtrace, which we don't want. > + func_frame_chain_valid checks both for `main', and for the entry > + point function. */ > + /* Use the alternate method of determining valid frame chains. */ > + #define FRAME_CHAIN_VALID(fp,fi) func_frame_chain_valid (fp, fi) > + > #undef FRAME_CHAIN > #define FRAME_CHAIN(frame) i386_linux_frame_chain (frame) > extern CORE_ADDR i386_linux_frame_chain (struct frame_info *frame); > -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer