From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6487 invoked by alias); 4 Feb 2002 02:21:06 -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 6346 invoked from network); 4 Feb 2002 02:21:03 -0000 Received: from unknown (HELO zenia.red-bean.com) (208.245.165.38) by sources.redhat.com with SMTP; 4 Feb 2002 02:21:03 -0000 Received: (from jimb@localhost) by zenia.red-bean.com (8.9.3/8.9.3) id VAA21952; Sun, 3 Feb 2002 21:06:36 -0500 Date: Sun, 03 Feb 2002 18:21:00 -0000 Message-Id: <200202040206.VAA21952@zenia.red-bean.com> X-Authentication-Warning: zenia.red-bean.com: jimb set sender to jimb@zenia.red-bean.com using -f From: Jim Blandy To: gdb-patches@sources.redhat.com Subject: RFA: Recognize bottom of stack on Linux X-SW-Source: 2002-02/txt/msg00055.txt.bz2 Now, some folks feel that GDB should show the whole stack, including _start, __libc_start_main, and anything else that's there. However, this isn't the way GDB has ever traditionally behaved on native targets. So this patch makes GDB's backtraces end after main. 2002-02-03 Jim Blandy * i386-linux-tdep.c (i386_linux_frame_chain): Stop the frame chain after `main', not just after the compilation unit containing the entry point. Index: gdb/i386-linux-tdep.c =================================================================== RCS file: /cvs/cvsfiles/devo/gdb/i386-linux-tdep.c,v retrieving revision 2.7.10.1 diff -c -r2.7.10.1 i386-linux-tdep.c *** gdb/i386-linux-tdep.c 2002/01/11 22:08:41 2.7.10.1 --- gdb/i386-linux-tdep.c 2002/02/04 02:19:28 *************** *** 352,358 **** if (frame->signal_handler_caller || FRAMELESS_SIGNAL (frame)) return frame->frame; ! if (! inside_entry_file (frame->pc)) return read_memory_unsigned_integer (frame->frame, 4); return 0; --- 352,364 ---- if (frame->signal_handler_caller || FRAMELESS_SIGNAL (frame)) return frame->frame; ! /* 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 GDB's other ! targets), the `PC in compilation unit containing entry point' ! rule triggers too late to get us the right result. */ ! if (! inside_entry_file (frame->pc) ! && ! inside_main_func (frame->pc)) return read_memory_unsigned_integer (frame->frame, 4); return 0;