From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10153 invoked by alias); 18 Mar 2010 03:00:36 -0000 Received: (qmail 10144 invoked by uid 22791); 18 Mar 2010 03:00:35 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org Received: from mail-px0-f203.google.com (HELO mail-px0-f203.google.com) (209.85.216.203) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Mar 2010 03:00:31 +0000 Received: by pxi41 with SMTP id 41so1303179pxi.23 for ; Wed, 17 Mar 2010 20:00:30 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.119.1 with SMTP id r1mr992638wfc.314.1268881230380; Wed, 17 Mar 2010 20:00:30 -0700 (PDT) In-Reply-To: <11611.203.63.255.139.1268879984.squirrel@webmail5.pair.com> References: <11611.203.63.255.139.1268879984.squirrel@webmail5.pair.com> From: Hui Zhu Date: Thu, 18 Mar 2010 03:00:00 -0000 Message-ID: Subject: Re: Getting pissed off by gdb. Please help with stepping in. To: temp@sourceboost.com Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 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/msg00117.txt.bz2 s #step into bar finish #finish the bar and into foo On Thu, Mar 18, 2010 at 10:39, wrote: > I had to use gdb many times over the years all the time it pisses me off > with one of its features and makes me move back to microsoft debugger as > soon as possible. Now I want to get to the bottom of it and figure out if > it's me or gdb. I'm talking about stepping into a function. Imagine a call > to a function 'foo' that has one argument and the value of this argument > is returned by a call to another function 'bar' like: > > ... > foo( bar() ); > ... > > All I want to do is to step into 'foo' without having to set any > additional breakpoints. > > When I use microsoft debugger and do step into on this line I get into the > function 'bar' first. Than I step out what brings me back to the line > where 'foo' is called. I do another step into and get into 'foo'. > > 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. > > Pavel > > > > > >