rob
rob

Reputation: 121

GDB version settings for 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 ?

Upvotes: 6

Views: 2380

Answers (3)

Jon
Jon

Reputation: 71

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")

Upvotes: 7

dicroce
dicroce

Reputation: 46780

This combination worked for me:

(defvar gud-gdb-command-name "arm-none-linux-gnueabi-gdb")
(setq gud-gdb-command-name "arm-none-linux-gnueabi-gdb --annotate=3")

Without the defvar, it didn't work.

Upvotes: 1

jtahlborn
jtahlborn

Reputation: 53694

did you try setting up your PATH so that the gdb you want is the first one found (prior to starting emacs, of course)? (by the way, i don't even see a "gdb-command-name" variable).

Upvotes: 0

Related Questions