Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GDB version settings for emacs

Tags:

emacs

I use emacs version 23.1 for C/C++ debugging. The GDB version this version of emacs picks by default is 5.2.1. I would like to use GDB version 7.0.

I have tried the following options :-

  1. Make an Alias(in ~/.alias) for gdb to the desired location of gdb (ie. location of gdb version 7.0.)

  2. Add the line (setq gdb-command-name "/grid/common/bin/gdb") to the ~/.emacs file.

Both the above options don't work. Can anyone please help ?

like image 382
rob Avatar asked May 13 '11 17:05

rob


People also ask

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.


1 Answers

rob, I tried your 2nd option as well, but it didn't work. I then took a suggestion from dicroce and just changed the variable from gdb-command-name to gud-gdb-command-name and that did it. So here's what I put in my .emacs file:

; Attempt to reassign the default gdb command to point to gdb64
(setq gud-gdb-command-name "/apps/gdb64/bin/gdb --annotate=3")
like image 88
Jon Avatar answered Sep 19 '22 14:09

Jon