我有铿锵++ 4.1
clang++ -v
Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.2
Thread model: posix
我也有 lldb 167.5
lldb -v
LDB-167.5
我用这个命令编译了简单的 c++ 代码。
clang++ testit.cpp -std=c++11 -stdlib=libc++ -g -o a
当我尝试用 lldb 调试它时,我执行了 lldb ./a,设置断点b main
并运行。
lldb) r
Process 44582 launched: '/Users/smcho/Desktop/cpp11/lldb/a' (x86_64)
Process 44582 stopped
* thread #1: tid = 0x1f03, 0x00000001000007e8 a`main [inlined] std::__1::__vector_base<std::__1::unique_ptr<A, std::__1::default_delete<A> >, std::__1::allocator<std::__1::unique_ptr<A, std::__1::default_delete<A> > > >::__vector_base() at vector:460, stop reason = breakpoint 1.1
frame #0: 0x00000001000007e8 a`main [inlined] std::__1::__vector_base<std::__1::unique_ptr<A, std::__1::default_delete<A> >, std::__1::allocator<std::__1::unique_ptr<A, std::__1::default_delete<A> > > >::__vector_base() at vector:460
457 _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
458 : __begin_(0),
459 __end_(0),
-> 460 __end_cap_(0)
461 {
462 }
463
C++ 源代码在这篇文章中:How to print the content in vector<unique_ptr> with gdb on Mac OS X
可能有什么问题?