I've been using Xcode 5 for a while now and I can't figure out how to debug into the STL source headers. The option "Step Into" (F7) just skips over the statement I would like the debugger to step into, and I don't find a setting to change this behavior. I remember people complaining about previous versions of Xcode where stepping into the STL sources could not be turned off... it's frustrating.
Asked
Active
Viewed 1,451 times
4
-
I assume you're building *debug* bits, right? because part of the beauty of the standard library is its incredible propensity to inline huge chunks of its code when optimized in release-builds. Thus, there is nothing to "step into". – WhozCraig Oct 16 '13 at 21:17
1 Answers
15
There is a setting in lldb that controls this:
(lldb) settings show target.process.thread.step-avoid-regexp
target.process.thread.step-avoid-regexp (regex) = ^std::
As you see, by default it is set not to step into anything in the std namespace. Just make a file called .lldbinit
in your home directory, and put in that:
settings set target.process.thread.step-avoid-regexp ""
and we will no longer skip over functions in std.

Jim Ingham
- 25,260
- 2
- 55
- 63
-
Hey I realize it's been like seven years but I tried this and it works. I'd like to make sure that this doesn't affect any inlining in release builds and wanted to know if this really is just a setting that lldb doesn't step into the std namespace. Thank you if you do see this. – James51332 Jul 29 '21 at 16:32
-
Yup, this is all on lldb's side. It doesn't kick in until in the course of executing a "step in" operation lldb lands in code matching the step-avoid-regexp. Then, instead of stopping, we schedule a "step out" and continue on with the step-in operation we were in the middle of. – Jim Ingham Jul 29 '21 at 18:06
-
Thanks man even if I was literally almost 8 years late.. I was only 7 then... – James51332 Jul 30 '21 at 04:19