user1779657
user1779657

Reputation: 59

gdb in emacs, no such file or directory

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

Answers (3)

user2053036
user2053036

Reputation:

Maybe emacs isn't picking up the right path, try this

  1. Switch to scratch buffer
  2. Then type 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

xxks-kkk
xxks-kkk

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:

  1. 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

  2. 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

korkutserkan
korkutserkan

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

Related Questions