Reputation: 59
Trying to use gdb in emacs, but every time I run it, I get the message No such file or directory, gdb. My research initially led me to understand that it was not installed, so I have now installed a copy of gdb that seemed to go ok, but it seems that it is not being used by emacs.
I am running Emacs version 24.3 (9.0) on mac OSX Mavericks, and as far as I am aware I have gdb 7.6 installed.
Does anyone know what the problem might be?
Kind regards
Rob
Upvotes: 2
Views: 2352
Reputation:
Maybe emacs isn't picking up the right path, try this
C-u M-: (getenv "PATH") RET
The above will print the value of PATH
in the buffer, check if it has the path to gdb
Upvotes: 1
Reputation: 2608
I run into the similar problem. I'm using Yosemite. I install gdb using macports port install gdb
and the gdb is installed as ggdb
instead of gdb
under /opt/local/bin/ggdb
.
The way I workaround the problem is the following:
I first create an symbolic soft link under my $HOME/bin
directory (i.e. /Users/zeyuan/bin
): ln -s /opt/local/bin/ggdb $HOME/bin/gdb
Then I add the following chunk under emacs init.el
:
(setenv "PATH" "/Users/zeyuan/bin:$PATH" t)
(add-to-list 'exec-path "/Users/zeyuan/bin")
With these two steps, I can invoke gdb
through emacs. Hope it helps!
Upvotes: 1
Reputation: 1
I have encountered the same situation and found a solution at http://comments.gmane.org/gmane.emacs.help/100522
Adding below code to my .emacs file has solved the problem for me
(add-to-list 'load-path "~/elisp")
(require 'exec-path-from-shell)
(when (memq window-system '(mac ns))
(exec-path-from-shell-initialize))
Hope that will help
Upvotes: 0