当试图退出C ++ 11 std lib时,调试器会更深入

问题描述:

我在Xcode 4.5中使用(Apple)LLVM 4.1(但我在早期的测试版中看到了相同的东西)。
我有它的目标C ++ 11和使用libc ++(新的,启用C ++ 11,std库的LLVM版本)。

I'm using (Apple) LLVM 4.1 within Xcode 4.5 (but I saw the same thing in an earlier beta). I have it targeting C++11 and am using libc++ (the new, C++11 enabled, LLVM version of the std library).

一个调试版本,如果我试图跨过代码调用到std库函数(例如std :: vector构造函数)调试器停止在std lib实现,如果我试图逐步更进一步的步骤!
在我回到自己的代码之前,可能需要几个(有时是10个或更多)失败。

In a debug build, if I try to step over code that calls into a std library function (e.g. a std::vector constructor) the debugger stops in the std lib implementation and if I try to step out it steps even deeper! It can take several (sometimes 10 or more) step-outs before I get back to my own code (and I never wanted to step in in this first place).

在视图中总是有一个_LIBCPP_DEBUG宏,以及_LIBCPP_INLINE_VISIBILITY - 但这些似乎无处不在,所以我不知道它是一个相关性。

There always seems to be a _LIBCPP_DEBUG macro in view, as well as _LIBCPP_INLINE_VISIBILITY - but these seem to be everywhere so I'm not sure it's a correlation. It does seem plausible that it has something to do with the way inlining is working, though.

我没有找到任何其他人遇到这个问题的例子,但是它与内联的工作方式有关。 - 但是,对我来说,它已经持续了几个beta - 发布 - 并通过完全重新安装操作系统。

I've not been able to find any examples of anyone else with this problem - yet, for me, it has persisted across several betas - into the release - and through a complete reinstall of the OS.

有任何人甚至见过这个? - 但更好的是仍然知道发生了什么。

Has anyone else even seen this? - but better still knows what's going on?

在Xcode 4.5中的lldb不处理内联函数。 libc ++标准库有许多函数,它们总是内联的,即使是在-O0时,这也是一个问题。看起来Jim Ingham在一个月前就工作过了,例如。请参见第一个补丁 http://llvm.org/viewvc/llvm-project?view=rev& revision = 163044 和几个后续补丁在接下来的一两个星期,但当然不是在lldb的发布版本。您可以从公共站点 http://lldb.llvm.org/ 构建和使用命令行版本的lldb(参见特定 http://lldb.llvm.org/build.html ),唯一棘手的是要记住跟随lldb / docs / code-signing.txt中的代码签名说明。

lldb in Xcode 4.5 doesn't handle stepping over inlined functions. The libc++ standard library has many functions that are always inlined, even when built at -O0, which makes this a problem. It looks like Jim Ingham worked on this about a month ago, e.g. see the first patch http://llvm.org/viewvc/llvm-project?view=rev&revision=163044 and several follow-on patches over the following week or two, but of course those aren't in a released version of lldb yet. You can build and use a command line version of lldb from the public site, http://lldb.llvm.org/ (see in particular http://lldb.llvm.org/build.html ), the only tricky bit is to remember to follow the code signing instructions in lldb/docs/code-signing.txt.