[lldb-dev] Problem unwinding from inside of a CRT function

jingham at apple.com jingham at apple.com
Tue Mar 10 17:52:52 PDT 2015


Yeah, it would be kind of silly to recurse all the way down before stepping all the way back out.  When you are stepping IN, you have to at least get all the way to the target function - stepping through trampolines - because otherwise it is hard to tell whether the function you will eventually land in has debug info or not.  But for step OVER you can just get right out of anything you've stepped into.

Jim


> On Mar 10, 2015, at 5:41 PM, Zachary Turner <zturner at google.com> wrote:
> 
> Ok crisis averted.  Part of why this thread dragged out for so long is because I kept thinking it did this all the way down and it seemed unnecessary and problematic to allow code arbitrarily deep on the stack to mess up unwinding.
> 
> Thanks.
> 
> On Tue, Mar 10, 2015 at 5:35 PM Greg Clayton <gclayton at apple.com> wrote:
> 
> > On Mar 10, 2015, at 5:26 PM, Zachary Turner <zturner at google.com> wrote:
> >
> > I'm going to be revisiting this soon, but one thing I was never clear about.
> >
> > If I step over a function call, does it do this algorithm of single stepping a call instruction and then running until the next branch point _all the way down_, or does it only do it one level deep?  In other words, say I have this code
> >
> > void baz() {
> >   printf("Test");
> > }
> >
> > void bar() {
> >    baz();
> > }
> >
> > void foo() {
> >    bar();
> > }
> >
> > and I'm inside of foo(), and I want to step over bar.  It will single step the call, end up inside of bar.  Then run to the next branch point.  Does it now single step baz, end up in baz, run to next branch point, and then single step printf, and then continue this all the way down?  Or once it figures out where it is inside of bar, that's sufficient to let it run until the return address?
> 
> The latter. It will stop at the first instruction of "bar()" and then set a BP on the return address and continue to it, then continue with the source level single step over you started with (if there are any instructions left after the return BP is hit.
> 





More information about the lldb-dev mailing list