From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12880 invoked by alias); 11 Jul 2005 18:19:15 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 12860 invoked by uid 22791); 11 Jul 2005 18:19:08 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 11 Jul 2005 18:19:08 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1Ds2rz-0001Ek-CN; Mon, 11 Jul 2005 14:19:07 -0400 Date: Mon, 11 Jul 2005 18:19:00 -0000 From: Daniel Jacobowitz To: Jonathan Larmour Cc: gdb@sources.redhat.com Subject: Re: Thread backtrace termination Message-ID: <20050711181907.GA4551@nevyn.them.org> Mail-Followup-To: Jonathan Larmour , gdb@sources.redhat.com References: <42D29C67.4070509@eCosCentric.com> <20050711162326.GA32686@nevyn.them.org> <42D2B1CD.2020605@eCosCentric.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42D2B1CD.2020605@eCosCentric.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-07/txt/msg00126.txt.bz2 On Mon, Jul 11, 2005 at 06:52:13PM +0100, Jonathan Larmour wrote: > Daniel Jacobowitz wrote: > >On Mon, Jul 11, 2005 at 05:20:55PM +0100, Jonathan Larmour wrote: > > > >>The two "global constructors keyed to cyg_scheduler_start" lines are > >>bogus frame entries, although those also happened with GDB 6.1. The > >>"corrupt stack" whinge is new, and is treated as an error, including > >>terminating gdbinit scripts etc. > > > > > >This is already changed in CVS. > > Okay. I haven't seen that. It still looks like an error to me in frame.c. The error is caught in the top level code for the backtrace command; that effectively downgrades it to a warning and backtrace termination. > BTW, my other web searches seem to indicate that a fair few (naive) people > are thinking they are having stack corruption because GDB thinks there > might be. That's unfortunate. What else would you suggest? GDB is confused. From its point of view, the stack _is_ corrupt. > I've had a search for this and not found anything. I'm probably just not > using the right terms. Do you have a pointer, time frame or some search > terms I can use to pin this down? Thanks. Well, the patch was: 2005-04-08 Daniel Jacobowitz * dwarf2-frame.c (struct dwarf2_frame_cache): New field undefined_retaddr. (dwarf2_frame_cache): Initialize undefined_retaddr. (dwarf2_frame_this_id): Return an invalid frame ID if undefined_retaddr. You can find the discussion and sample use on gdb@ a month or two earlier. > >For compiler-generated code there's really no useful way to do this. > > I guess atleast now I know that, which saves me spending more time. > > Wouldn't it make sense to make such a convention though, such as having a > return address of 0? This is basically a convention. You could, I suppose, patch a compiler to generate it. I'm not sure that would be wise. > Alternatively, how about adding a new command that allows you to define a > set of entry point symbol names? People can then put an appropriate list > for themselves or their OS in ~/.gdbinit. Or it can be pre-initialised by > the OS support within GDB if there is one. e.g. nm-linux.h. Here's what > I'm thinking of: > > set entry-point-name-list main _start _entry > > Although handling mangled symbols and multiple languages might be fun. I'm > not an expert on such things. *shrug* maybe. -- Daniel Jacobowitz CodeSourcery, LLC