如何像Visual Studio中那样,像察看数组一样察看vector
-
- 帖子: 85
- 注册时间: 2008-10-06 22:19
如何像Visual Studio中那样,像察看数组一样察看vector
我所说的vector是C++标准库中stl::vector,Visual Studio的监视可以直接像监视数组一样监视它,而为什么 Eclipse 、Netbeans 都不行,说实话,Linux平台下,我最喜欢的IDE是Netbeans
- xhy
- 帖子: 3916
- 注册时间: 2005-12-28 1:16
- 系统: Ubuntu 12.10 X64
- 来自: 火星
-
- 帖子: 57
- 注册时间: 2009-01-05 11:42
Re: 如何像Visual Studio中那样,像察看数组一样察看vector
gdb 中自己定义查看的函数!
-
- 帖子: 85
- 注册时间: 2008-10-06 22:19
Re: 如何像Visual Studio中那样,像察看数组一样察看vector
我不会啊,教教我吧,谢谢了kamasamikon 写了:gdb 中自己定义查看的函数!
-
- 帖子: 85
- 注册时间: 2008-10-06 22:19
Re: 如何像Visual Studio中那样,像察看数组一样察看vector
我不会啊,教教我吧,谢谢了kamasamikon 写了:gdb 中自己定义查看的函数!
-
- 帖子: 57
- 注册时间: 2009-01-05 11:42
Re: 如何像Visual Studio中那样,像察看数组一样察看vector
http://www.ibm.com/developerworks/cn/ai ... u-gdb.htmlclarkyzl 写了:我不会啊,教教我吧,谢谢了kamasamikon 写了:gdb 中自己定义查看的函数!
http://www.ibm.com/developerworks/aix/l ... trace.html
这里有一些相关信息。
由于我也只知道一些很简单的,我很少用C++,更不懂STL,所以也没有那么复杂的需求。那你也只能自救了。
还有个可替换的方法,就是你自己在程序中写一个打印STL的函数,然后在 GDB 中使用 call 命令,就可以了。
// your source-code.cpp
void dump_vector(void *addr)
{
printf("xx is :%d\n", addr->xxx);
}
// gdb 命令行
(gdb) call dump_vector(0xYourVecAddress)
- BigSnake.NET
- 帖子: 12522
- 注册时间: 2006-07-02 11:16
- 来自: 廣州
- 联系:
Re: 如何像Visual Studio中那样,像察看数组一样察看vector
正解...xhy 写了:终极万能DEBUG方式 写log
^_^ ~~~
要理解递归,首先要理解递归。
地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
要理解递归,首先要理解递归。
地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
- BigSnake.NET
- 帖子: 12522
- 注册时间: 2006-07-02 11:16
- 来自: 廣州
- 联系:
Re: 如何像Visual Studio中那样,像察看数组一样察看vector
写log就是打印调试信息的意思
^_^ ~~~
要理解递归,首先要理解递归。
地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
要理解递归,首先要理解递归。
地球人都知道,理论上,理论跟实际是没有差别的,但实际上,理论跟实际的差别是相当大滴。
-
- 帖子: 43
- 注册时间: 2009-06-07 9:58
Re: 如何像Visual Studio中那样,像察看数组一样察看vector
哈哈,这个问题,我最近刚刚在codeblocks论坛里面和几个人讨论一起解决呢,欢迎来一起讨论!
地址是:
http://forums.codeblocks.org/index.php/ ... l#msg73150
已经解决了一部分了,嘿嘿。
地址是:
http://forums.codeblocks.org/index.php/ ... l#msg73150
已经解决了一部分了,嘿嘿。
OpenCV & Codeblocks
- xiaocheng_zh
- 帖子: 46
- 注册时间: 2009-05-30 15:52
- 来自: DL LIAONING CHN
Re: 如何像Visual Studio中那样,像察看数组一样察看vector
偶在CODE::BLOCK下的debug如下:#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef vector<string> vstr;
int main()
{
vstr v;
v.push_back("bla bla");
v.push_back("abcdef");
string v0 = v[0];
cout << "Hello world!" << endl;
return 0;
}
Debug
Adding source dir: E:\vec\
Adding source dir: E:\vec\
Adding file: bin\Debug\vec.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.7.50.20071127
Child process PID: 8684
Program exited normally.
Debugger finished with status 0
-
- 帖子: 43
- 注册时间: 2009-06-07 9:58
Re: 如何像Visual Studio中那样,像察看数组一样察看vector
请下载SVN的代码,自己编译。这个功能最近才放进去.
估计过几天的nightliy build里面就有的!
估计过几天的nightliy build里面就有的!
OpenCV & Codeblocks
-
- 帖子: 85
- 注册时间: 2008-10-06 22:19
-
- 帖子: 43
- 注册时间: 2009-06-07 9:58