Eclipse CDT Kepler 不允许"Display as array..."
Eclipse CDT Kepler does not allow "Display as array..."
我正在尝试使用Eclipse CDT:调试C++程序
#include <vector>
using namespace std;
int main() {
vector<int> test (4,100);
return 0;
}
如果我放置一个断点进行调试,并单击矢量变量的"显示为数组…",我会得到以下错误:
(*((test)+0)@4) Error: Multiple errors reported. Failed to execute MI command: -var-create - * (*((test)+0)@4) Error message from debugger back end: No symbol "operator+" in current context. Unable to create variable object
调试时如何查看数组的值?
我正在使用:
- Eclipse 4.3(开普勒)
- Ubuntu 13 64位
- gcc 4.7.3(使用
-g3
和-O0
编译) - gdb 7.5.91
- GDB(DSF)创建进程启动器
Eclipse可以在这里和这里查看快照和说明。这篇文章也帮助了我。
深入std::vector
变量的结构,查找名为_M_start
或类似的s.th(可能取决于实现)
将此类型转换为您知道并希望看到的最终类型数组。
原因是std::vector<T>
只是在内部封装和管理T
的数组,因此不能作为数组本身显示。
相关文章:
- C++11 中不同类型的对象的 std::array 的替代方案
- constexpr begin of a std::array
- C++如果必须在编译时确定大小,std::array 有什么意义?
- OpenGL VBO Indexing ( How to compute Index Array)
- 标准::unordered_map 中的 std::array 的值初始化
- "Warning: Comma within array index expression"但逗号分隔函数参数
- 确保编译时的特定 std::array 位置
- std::array的长度有大小限制吗?
- 将 std::array 移动到另一个 std::array
- 首先按给定顺序打印所有数字,然后使用 Array 打印所有字符和其他符号
- 为什么 std::shared_ptr 被认为是"heavy"和"expensive",但 std::array "same perfprmance as plain (c-style) arrays
- 将 **float array 从 C++ Dll 传递给 python
- std::bind on statd::array 的运算符 []
- 检查输入 std::array 指针数据是否等于某个常量数组
- 我可以安全地复制矢量<array>吗?
- 解析问题 - 预期的非限定 ID - #include <array> 编译错误
- 如何读/写或遍历 std::array 中的特定元素范围?
- 通过 host() 从 af::array 检索数据会导致错误的数据
- 是否可以使用 std::array 作为 POD 结构的数据容器?
- Eclipse CDT Kepler 不允许"Display as array..."