From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3231 invoked by alias); 11 Jul 2005 16:23:31 -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 3200 invoked by uid 22791); 11 Jul 2005 16:23:28 -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 16:23:28 +0000 Received: from drow by nevyn.them.org with local (Exim 4.52) id 1Ds142-0008WF-IT; Mon, 11 Jul 2005 12:23:26 -0400 Date: Mon, 11 Jul 2005 16:23:00 -0000 From: Daniel Jacobowitz To: Jonathan Larmour Cc: gdb@sources.redhat.com Subject: Re: Thread backtrace termination Message-ID: <20050711162326.GA32686@nevyn.them.org> Mail-Followup-To: Jonathan Larmour , gdb@sources.redhat.com References: <42D29C67.4070509@eCosCentric.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42D29C67.4070509@eCosCentric.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-07/txt/msg00122.txt.bz2 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. > I tried reverting > , but that > in itself isn't the issue. I know there were a bunch of other dwarf > unwinder changes for GDB 6.2. But rather than try and explain what I've > already tried to do, I'd be interested if someone could clarify to me what > the termination conditions for a backtrace actually _are_. i.e. as an OS > author, how do I initialise a thread context to persuade GDB to stop when > it reaches the innermost frame. I've tried looking at the glibc sources to > see how its thread support works, but it's rather a twisty maze of > passages, and I don't know whether it would have this problem as well > anyway. In general there's no defined way to do this. If the start routine is written in assembly, take a look at the example I posted earlier this year of using dwarf2 unwind information to terminate a backtrace by marking the return address column as undefined. There's a matching GDB patch, which was committed to HEAD after 6.3. For compiler-generated code there's really no useful way to do this. -- Daniel Jacobowitz CodeSourcery, LLC