简体   繁体   English

任何人都知道C ++的良好免费调试器吗?

[英]Anyone know a good, free debugger for C++?

I've been having a really hard time with those kinds of bugs that just don't make any sense, and an even bigger one with trying to figure out how Code::Blocks' debugger works. 对于那些根本没有任何意义的错误,我一直处在非常困难的时期,而试图弄清Code :: Blocks调试器的工作原理则是一个更大的难题。 If there's any way to make it show pointers' contents, or to be able to switch between scopes' variables, then my problems would be solved already, though alternatives are always welcome. 如果有任何方法可以显示指针的内容,或者可以在范围变量之间切换,那么我的问题已经解决,尽管总是欢迎使用替代方法。

Help me out guys, scattering couts through the entire code is the most counter-intuitive and insanity-inducing burden ever. 帮帮我,在整个代码中散布线索是有史以来最违反直觉和精神错乱的负担。 D| d |

edit: OS is Windows 编辑:操作系统是Windows

VS2012 Express是免费的。

g ++ http://gcc.gnu.org/ “ GNU编译器集合包括C,C ++,Objective-C,Fortran,Java,Ada和Go的前端,以及这些语言的库(libstdc ++,libgcj。 ..)。GCC最初是作为GNU操作系统的编译器编写的。GNU系统开发为100%免费的软件,在尊重用户自由的意义上说是免费的。”

If there's any way to make it show pointers' contents 如果有什么办法可以显示指针的内容

Yes. 是。 In Code::Blocks in you should be able to right-click and pointer in the Watches list and select 'Dereference pointer'. 在Code :: Blocks中,您应该可以右键单击并在Watches列表中找到指针,然后选择“取消引用指针”。 If the pointer is a member of an object, you may have to add it manually by right-clicking in the Watches list and and typing the full reference to the member. 如果指针是对象的成员,则可能必须通过右键单击“监视”列表并键入对该成员的完整引用来手动添加它。

// Type 'pA->int1' in the 'Add watch' and code::blocks should add it. 
class A {
  public:
    int int1;
};

int main()
{
  A * pA = new A;
}

To add to other answers (obviously GDB...), LLDB is BSD-style licensed which is more permissive. 为了增加其他答案(显然是GDB ...), LLDB是BSD样式许可的,这是更宽松的。 It is part of the LLVM Compiler Infrastructure . 它是LLVM编译器基础结构的一部分 is very similar to GDB (see a comparison ). 与GDB非常相似(请参阅比较 )。

Following your edit: it is not ready for windows yet but efforts are under way so it should be soon. 编辑后:它尚未准备好用于Windows,但正在努力,因此应尽快进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM