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.