This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Getting pissed off by gdb. Please help with stepping in.
- From: Nathan Froyd <froydnj at codesourcery dot com>
- To: temp at sourceboost dot com
- Cc: gdb at sourceware dot org
- Date: Wed, 17 Mar 2010 20:03:05 -0700
- Subject: Re: Getting pissed off by gdb. Please help with stepping in.
- References: <11611.203.63.255.139.1268879984.squirrel@webmail5.pair.com>
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