Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Beginners' guide for setting up Emacs with gcc/gdb? [closed]

Tags:

I looked around the GNU emacs material and didn't find anything helpful.

Does anyone know of a good tutorial for setting up emacs, to basically turn it into an IDE? I'm looking for interfacing with gcc/gdb/make, etc...

like image 406
Yuval Adam Avatar asked Apr 23 '09 17:04

Yuval Adam


People also ask

What is GCC and GDB?

gcc is a debugger by GNU project. Gdb can step through your source code line-by-line or even instruction by instruction. You may also watch the value of any variable at run-time. In additon, it also helps to identify the place and the reason making the program crash.

Does Emacs have a debugger?

Emacs provides a special interface to GDB, which uses extra Emacs windows to display the state of the debugged program. See GDB Graphical Interface. Emacs also has a built-in debugger for Emacs Lisp programs.

What is Emacs gud?

The Grand Unified Debugger, or GUD for short, is an Emacs major mode for debugging. It works on top of command line debuggers. GUD handles interaction with gdb, dbx, xdb, sdb, perldb, jdb, and pdb, by default.


Video Answer


1 Answers

Like other answers mentioned, M-x compile, M-x gdb will get you going. While debugging, I'd also suggest gdb-many-windows-mode, which makes Emacs look a bit closer to IDE when debugging.

Besides that and to get closer to "IDE-like features", you can look at:

  • CEDET http://cedet.sourceforge.net/ for code completion and project support. Excellent tutorial at http://xtalk.msk.su/~ott/en/writings/emacs-devenv/EmacsCedet.html .
  • If you don't mind using non-free software, Xrefactory (http://www.xref.sk/xrefactory/main.html) is probably the best (well, the only) refactoring tool. The C version is free, the C++ is not.
like image 195
Laurynas Biveinis Avatar answered Oct 12 '22 03:10

Laurynas Biveinis