对 STL 调试提供适当支持的 Linux IDE
我正在寻找一个支持 STL 调试的 Linux IDE。
问题是,使用 Eclipse CDT,如果我在 push_back 之后检查向量:
int main() {
vector<string> v;
v.push_back("blah");
return 0;
}
我会得到一些敌意的东西
{<std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {_M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data fields>}, _M_start = 0x1fee040, _M_finish = 0x1fee048, _M_end_of_storage = 0x1fee048}}, <No data fields>}
,而
vector["blah"]
不是类似的东西。 是否有适用于 Linux 的替代 IDE/调试器可以提供更好的 STL 支持?
I am looking for a Linux IDE with support for STL debugging.
the problem is that with Eclipse CDT, if I inspect the vector after the push_back:
int main() {
vector<string> v;
v.push_back("blah");
return 0;
}
I get something hostile like
{<std::_Vector_base<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >> = {_M_impl = {<std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<__gnu_cxx::new_allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >> = {<No data fields>}, <No data fields>}, _M_start = 0x1fee040, _M_finish = 0x1fee048, _M_end_of_storage = 0x1fee048}}, <No data fields>}
instead of something like
vector["blah"]
or something similar.
is there an alternative IDE/Debugger for linux that provides better STL support?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
QtCreator 具有用于 Qt 容器、一些 STL 容器和一堆的调试器转储器Qt 类。它的响应速度也比 Eclipse 更快。
请参阅 Qt Creator 调试器转储器。
QtCreator has debugger dumpers for the Qt containers, some of the STL containers and a bunch of the Qt classes. It's also more responsive than Eclipse.
See Qt Creator debugger dumpers.
只需编写 GDB 脚本即可打印 stl 容器。
打印矢量:
现在您甚至可以在 python 上编写脚本。检查文档。
我个人使用cgdb,这是一个非常方便的curses调试器。
Just a matter of scripting GDB so you can print stl containers.
To print a vector:
Now you can even script it on python. Check the documentation.
I personally use cgdb which is a very convenient curses debugger.
这与 IDE 本身无关,但这是您所使用的调试器的一个缺点。 IDE,尤其是 Linux 上的 IDE,只是调试器的前端。我想您正在使用 GDB,它不会比这更好。顺便说一句,在 Linux 上开发时,我使用仔细放置的打印语句而不是调试器,大多数时候我发现它比使用调试器更好!
This has got nothing to do with the IDE per se, but this is a drawback of the debugger you are using. IDEs, especially on Linux, are just front-ends for debuggers. I suppose you are using GDB, and it won't get any better than this. BTW, while developing on Linux, I use carefully placed print statements instead of a debugger and most of the time I find it better than using a debugger!
Eclipse 使用 gdb,您可以编写 gdb 脚本,以便它按照您想要的方式打印不同的类型。我对自己的类型使用自己的脚本,但有许多可用的 stl 脚本。
现在棘手的部分是让 Eclipse 顺利完成这项工作,但它可以是一个解决方案。
Eclipse use gdb and you can script gdb so it print different types the way you want. I use my own scripts for my own types but there is many available scripts for the stl.
Now the tricky part will be to make this work smoothly is Eclipse, but it can be a solution.
如果您想远离 GDB 脚本,您不妨离开 Eclipse,转而使用 QtCreator 或者如果您不介意支付许可证费用 CLion 是 IMO 周围最好的 IDE。
If you want to stay away from GDB scripts you might as well leave Eclipse in favor of QtCreator or if you don't mind paying for a license CLion is the best IDE around IMO.