From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9945 invoked by alias); 22 Aug 2004 10:53:13 -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 9936 invoked from network); 22 Aug 2004 10:53:09 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (212.157.227.139) by sourceware.org with SMTP; 22 Aug 2004 10:53:09 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 2E5CB47D91; Sun, 22 Aug 2004 12:53:09 +0200 (CEST) Date: Sun, 22 Aug 2004 10:53:00 -0000 From: Joel Brobecker To: Tron Thomas , gdb@sources.redhat.com Subject: Re: How to step into multi-command statements Message-ID: <20040822105309.GB3447@gnat.com> References: <20040821174121.GA7442@white> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040821174121.GA7442@white> User-Agent: Mutt/1.4i X-SW-Source: 2004-08/txt/msg00280.txt.bz2 > You need to 'step', 'finish', 'step', 'finish', until you get to the > function that you want. Funny. One of our users actually asked for an enhancement to implement a function that would do a step-last, ie step into the last function being called in the line of code. For instance, given the following code: Foo (A, Bar (B)); steplast would land inside Foo, not Bar. The premise for this request was that WDB, the HP/UX debugger, was implementing it. I looked at HP's implementation, and they were basically using two approaches, as far as I can remember: - heuristics, knowing how calls where implemented on their target (this is for older versions of their compiler) - debug info, generated by their recent compiler. We are still not exactly sure that this would be very useful enhancement, especially if we don't get any help from the compiler as the HP compiler does. Right now, our position is that it is easy to write a user-command that does something close: define stepfunc tbreak $arg0 cont end With the function above, it's not entirely automatic, as you have to give the name of the function you want to step in, but it is also more flexible, as you can step into the function you want, it doesn't have to be the last function called. Food for thoughts... -- Joel