From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7201 invoked by alias); 18 Mar 2010 03:03:13 -0000 Received: (qmail 7070 invoked by uid 22791); 18 Mar 2010 03:03:11 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Mar 2010 03:03:07 +0000 Received: (qmail 14436 invoked from network); 18 Mar 2010 03:03:05 -0000 Received: from unknown (HELO localhost) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 18 Mar 2010 03:03:05 -0000 Date: Thu, 18 Mar 2010 03:03:00 -0000 From: Nathan Froyd To: temp@sourceboost.com Cc: gdb@sourceware.org Subject: Re: Getting pissed off by gdb. Please help with stepping in. Message-ID: <20100318030303.GA16726@codesourcery.com> References: <11611.203.63.255.139.1268879984.squirrel@webmail5.pair.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <11611.203.63.255.139.1268879984.squirrel@webmail5.pair.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00118.txt.bz2 On Wed, Mar 17, 2010 at 10:39:44PM -0400, temp@sourceboost.com wrote: > When I debug same code under gdb and do step into I get into 'bar'. So far > so good. I do a step out and wtf... Instead of getting back to the line > where 'foo' is called I get passed it. My step out of 'bar' command caused > call to 'foo' to execute as well. But I just wanted to step out of 'bar' > but not have 'foo' executed yet. Not happy. > > So my question is it possible to step out of a function in gdb in code > like above and remain on the line where this function was called from? > What's the secret? Please advise. I think the command you want to use, once you've 'step'd into bar is 'finish'. You don't say what you're using to "step out" of bar in GDB, so it's possible you're already following my suggestion. -Nathan