我想把所有的字符串打印到一个向量中。当我这样做的时候
(lldb) p myVector
(std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >) $30 = size=65 {
[0] = Summary Unavailable
[1] = Summary Unavailable
[2] = Summary Unavailable
[3] = Summary Unavailable
[4] = Summary Unavailable
[5] = Summary Unavailable
[6] = Summary Unavailable
[7] = Summary Unavailable
[8] = Summary Unavailable
[9] = Summary Unavailable
[10] = Summary Unavailable
[11] = Summary Unavailable
...
然而,打印单独的元素起作用,
p myVector[5].c_str()
(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >::value_type *) $31 = 0x0000600000210280 "-D__STDC_CONSTANT_MACROS"
我想一次打印所有元素,因为有相当多。
1条答案
按热度按时间wbgh16ku1#
将
-fstandalone-debug
添加到编译器命令行。我在cmake上为调试版本设置了以下内容: