This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Getting pissed off by gdb. Please help with stepping in.


s
#step into bar
finish
#finish the bar and into foo

On Thu, Mar 18, 2010 at 10:39,  <temp@sourceboost.com> 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
>
>
>
>
>
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]