- 论坛徽章:
- 0
|
源码很简单如下:
#include <iostream>
#include <string>
using namespace std;
int main()
{
int a = 123;
string b = "test";
cout << a << endl << b << endl;
return 0;
}
编译:
clang++-5.0 test.cpp -o test -g
调试:
lldb-5.0 ./test
b main
r
在后面打印这两个变量,如下:
(lldb) p a
(int) $0 = 123
(lldb) p b
error: incomplete type 'std::__cxx11::string' (aka 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >') where a complete type is required
forward declaration of 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >'
(lldb)
只能打印内置的类型,不能打印其他类型?
|
|