From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4890 invoked by alias); 2 Mar 2006 03:19:27 -0000 Received: (qmail 4873 invoked by uid 22791); 2 Mar 2006 03:19:26 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Thu, 02 Mar 2006 03:19:24 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FEeLZ-0006J9-GS; Wed, 01 Mar 2006 22:19:21 -0500 Date: Thu, 02 Mar 2006 03:19:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sources.redhat.com Subject: Re: Suggestion: backtrace stop guard for threads callstacks Message-ID: <20060302031921.GA24107@nevyn.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sources.redhat.com References: <20060302012943.GK1579@adacore.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060302012943.GK1579@adacore.com> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-03/txt/msg00037.txt.bz2 On Wed, Mar 01, 2006 at 05:29:43PM -0800, Joel Brobecker wrote: > It's a little bit less simple for the general case for C, C++ and other > languages, but I suggest we implement something similar. How about we > add some code that recognizes some of the thread entry-points? For > the GNU/Linux NPTL for instance, we could recognize clone() or perhaps > _start_thread? We could make the check as stringent as we like, for > instance not only check the funtion name, but also the object name, > to make sure we're inside the pthread library. FYI, this is discussed here about five times a year in one form or another. For systems we control, the correct solution is not this at all, but to add unwinding information or suitable prologues that indicate the end of the stack. Almost every architecture has a suitable sequence, and we have a recently-decided-upon DWARF convention to represent it also. Whatever platform you're looking at, does the beginning of _thread_start make sufficiently clear that we're at the end of the stack? If not, perhaps you should register an appropriate unwinder to notice it and stop. -- Daniel Jacobowitz CodeSourcery