哪个是最好的 Linux C/C + + 调试器(或 gdb 的前端)来帮助教授编程?

我教了一些“ lite”C + + 编程课程给新手(“ lite”意味着没有指针,没有类,只有普通的老 C,加上引用和 STL 字符串和向量)。学生以前没有编程经验,所以我相信使用交互式调试器可以帮助他们理解程序流、变量和递归。

这门课程是用 Linux 教授的。教他们使用 gdb 实在是太夸张了(他们不会使用或理解大多数特性)。我只需要一些简单但易于使用的东西: 查看程序现在在哪一行,堆栈中有什么(局部变量,以前的调用,等等)。我看起来有点像老的 Turbo Pascal 或 Turbo C + + Borland 的调试器,或者 Visual Studio 的调试器。

谢谢,

160569 次浏览

ddd is a graphical front-end to gdb that is pretty nice. One of the down sides is a classic X interface, but I seem to recall it being pretty intuitive.

You may want to check out Eclipse CDT. It provides a C/C++ IDE that runs on multiple platforms (e.g. Windows, Linux, Mac OS X, etc.). Debugging with Eclipse CDT is comparable to using other tools such as Visual Studio.

You can check out the Eclipse CDT Debug tutorial that also includes a number of screenshots.

Perhaps it is indirect to gdb (because it's an IDE), but my recommendations would be KDevelop. Being quite spoiled with Visual Studio's debugger (professionally at work for many years), I've so far felt the most comfortable debugging in KDevelop (as hobby at home, because I could not afford Visual Studio for personal use - until Express Edition came out). It does "look something similar to" Visual Studio compared to other IDE's I've experimented with (including Eclipse CDT) when it comes to debugging step-through, step-in, etc (placing break points is a bit awkward because I don't like to use mouse too much when coding, but it's not difficult).

Qt Creator, apart from other goodies, also has a good debugger integration, for CDB, GDB and the Symnbian debugger, on all supported platforms. You don't need to use Qt to use the Qt Creator IDE, nor do you need to use QMake - it also has CMake integration, although QMake is very easy to use.

You may want to use Qt Creator as the IDE to teach programming with, consider it has some good features:

  • Very smart and advanced C++ editor
  • Project and build management tools
  • QMake and CMake integration
  • Integrated, context-sensitive help system
  • Excellent visual debugger (CDB, GDB and Symbian)
  • Supports GCC and VC++
  • Rapid code navigation tools
  • Supports Windows, Linux and Mac OS X

You could try using Insight a graphical front-end for gdb written by Red Hat Or if you use GNOME desktop environment, you can also try Nemiver.