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

Greg Clayton gclayton at apple.com
Tue Mar 10 17:35:14 PDT 2015


> 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