Question

I am getting error: 'Searching for program: permission denied, gdb' when i try to run M-x gdb in emacs on windows machine. I have Mingw and it is in the emacs search path (getenv "PATH"). When I open a shell in emacs I can run gdb from the shell no problem. What causes this permission denied?

thanks

Was it helpful?

Solution

Ok, I figured it out with the help of this excellent page

Emacs has variable exec-path that will automatically sync with "PATH" variable. However, if you customize your "PATH" variable in emacs (i.e from within init.el), these changes won't be added to exec-path. So, you have to manually set the exec-path to contain the directory with the gdb executable. On the linked page there is some nice code to help keep the two paths in sync.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top