all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* gdb emacs no such file or directory gdb
@ 2014-01-16  4:38 Rob Kinsey
  2014-01-16 12:34 ` Tim Visher
  2014-01-16 19:51 ` Peter Dyballa
  0 siblings, 2 replies; 16+ messages in thread
From: Rob Kinsey @ 2014-01-16  4:38 UTC (permalink / raw)
  To: help-gnu-emacs

Hi guys, 

Having a little trouble getting gdb to work inside emacs on OSX Mavericks. I know it is installed, as it runs ok in the terminal, but if I try to debug a program in emacs, I get the message:

Searching for program: No such file or directory, gdb

So far my research has led be to understand that although the native front end is starting, emacs is not actually finding gdb itself. How can I link these two programs together, I have also tried searching though the emacs preferences to no avail.

Any help on this would be much appreciated.

Kind regards

Rob.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
  2014-01-16  4:38 Rob Kinsey
@ 2014-01-16 12:34 ` Tim Visher
  2014-01-16 19:51 ` Peter Dyballa
  1 sibling, 0 replies; 16+ messages in thread
From: Tim Visher @ 2014-01-16 12:34 UTC (permalink / raw)
  To: Rob Kinsey; +Cc: emacs

Hi Rob,

On Wed, Jan 15, 2014 at 11:38 PM, Rob Kinsey <psycho.dynamics@gmail.com> wrote:
> Having a little trouble getting gdb to work inside emacs on OSX Mavericks. I know it is installed, as it runs ok in the terminal, but if I try to debug a program in emacs, I get the message:
>
> Searching for program: No such file or directory, gdb
>
> So far my research has led be to understand that although the native front end is starting, emacs is not actually finding gdb itself. How can I link these two programs together, I have also tried searching though the emacs preferences to no avail.
>
> Any help on this would be much appreciated.

Sounds like your PATH in a shell and your Emacs exec-path don't agree.
Might you be using GUI Emacs?

If so, you'll need to make sure that you either muck with the
exec-path so that it contains a reference to the install location of
gdb _or_ do something like editing your launchd.conf file so that all
processes get the new PATH information.

--

In Christ,

Timmy V.

http://blog.twonegatives.com/
http://five.sentenc.es/ -- Spend less time on mail



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
  2014-01-16  4:38 Rob Kinsey
  2014-01-16 12:34 ` Tim Visher
@ 2014-01-16 19:51 ` Peter Dyballa
  1 sibling, 0 replies; 16+ messages in thread
From: Peter Dyballa @ 2014-01-16 19:51 UTC (permalink / raw)
  To: Rob Kinsey; +Cc: help-gnu-emacs


Am 16.01.2014 um 05:38 schrieb Rob Kinsey:

> So far my research has led be to understand that although the native front end is starting, emacs is not actually finding gdb itself. How can I link these two programs together, I have also tried searching though the emacs preferences to no avail.

Check the value of the variable exec-path! Check in Terminal the value of the environment variable PATH! Then make the value of exec-path contain the same directory elements!

There is also a way to launch GNU Emacs from the Terminal (has the correct path) à la:

	open /Applications/Emacs.app

Then it will inherit $PATH's value and set exec-path accordingly. (Mac OS X misses some understanding of setting paths on an UNIX system.)

--
Greetings

  Pete

Clovis' Consideration of an Atmospheric Anomaly:
        The perversity of nature is nowhere better demonstrated than by the fact that, when exposed to the same atmosphere, bread becomes hard while crackers become soft




^ permalink raw reply	[flat|nested] 16+ messages in thread

* gdb emacs no such file or directory gdb
@ 2014-10-21  0:12 Mike
  2014-10-21  6:44 ` Suvayu Ali
                   ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Mike @ 2014-10-21  0:12 UTC (permalink / raw)
  To: help-gnu-emacs

Hi guys,

I have just decided to use Emacs and GDB for my FORTRAN coding. Everything seem to work perfectly, but the GDB and Emacs integration. I know GDB is working fine since I can operate it in terminal, but as soon as I try to use it in Emacs I get "no such file or directory gdb".

This problem is probably related to disagreement between the PATH in a shell and my Emacs exec-path as already discussed in  https://groups.google.com/forum/#!topic/gnu.emacs.help/WkjoK2L57rE.

Unfortunately, I do not know how to set the PATH in Emacs. However, I tried the following from above link that did not work:
"There is also a way to launch GNU Emacs from the Terminal (has the correct path) à la: 

        open /Applications/Emacs.app 

Then it will inherit $PATH's value and set exec-path accordingly. (Mac OS X misses some understanding of setting paths on an UNIX system.) 
"

Does any one know how can I solve the problem?

Any help on this would be much appreciated. 
Kind regards 

Mike


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
  2014-10-21  0:12 gdb emacs no such file or directory gdb Mike
@ 2014-10-21  6:44 ` Suvayu Ali
       [not found] ` <mailman.11612.1413873879.1147.help-gnu-emacs@gnu.org>
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 16+ messages in thread
From: Suvayu Ali @ 2014-10-21  6:44 UTC (permalink / raw)
  To: help-gnu-emacs

On Mon, Oct 20, 2014 at 05:12:59PM -0700, Mike wrote:
> Hi guys,
> 
> I have just decided to use Emacs and GDB for my FORTRAN coding. Everything seem to work perfectly, but the GDB and Emacs integration. I know GDB is working fine since I can operate it in terminal, but as soon as I try to use it in Emacs I get "no such file or directory gdb".
> 
> This problem is probably related to disagreement between the PATH in a shell and my Emacs exec-path as already discussed in  https://groups.google.com/forum/#!topic/gnu.emacs.help/WkjoK2L57rE.

Maybe you can try something like this in your init file:

;; set PATH to use standalone texlive instead
(setenv "PATH" "/opt/texlive/2014/bin/x86_64-linux:$PATH" t)

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
       [not found] ` <mailman.11612.1413873879.1147.help-gnu-emacs@gnu.org>
@ 2014-10-21 13:34   ` Mike
  2014-10-21 16:15     ` Suvayu Ali
       [not found]     ` <mailman.11649.1413908125.1147.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 16+ messages in thread
From: Mike @ 2014-10-21 13:34 UTC (permalink / raw)
  To: help-gnu-emacs

On Tuesday, October 21, 2014 2:44:15 AM UTC-4, Suvayu Ali wrote:
> On Mon, Oct 20, 2014 at 05:12:59PM -0700, Mike wrote:
> 
> > Hi guys,
> 
> > 
> 
> > I have just decided to use Emacs and GDB for my FORTRAN coding. Everything seem to work perfectly, but the GDB and Emacs integration. I know GDB is working fine since I can operate it in terminal, but as soon as I try to use it in Emacs I get "no such file or directory gdb".
> 
> > 
> 
> > This problem is probably related to disagreement between the PATH in a shell and my Emacs exec-path as already discussed in  https://groups.google.com/forum/#!topic/gnu.emacs.help/WkjoK2L57rE.
> 
> 
> 
> Maybe you can try something like this in your init file:
> 
> 
> 
> ;; set PATH to use standalone texlive instead
> 
> (setenv "PATH" "/opt/texlive/2014/bin/x86_64-linux:$PATH" t)
> 
> 
> 
> Hope this helps,
> 
> 
> 
> -- 
> 
> Suvayu
> 
> 
> 
> Open source is the future. It sets us free.

Thank Suvayu for your reply.
In fact, I am migrating from windows (and Code Block) to mac (and Emacs), so I am quite new to OS X 10.10 and Emacs.
Could you please tell me how I can set the PATH as you said.
Thank you.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
  2014-10-21 13:34   ` Mike
@ 2014-10-21 16:15     ` Suvayu Ali
       [not found]     ` <mailman.11649.1413908125.1147.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 16+ messages in thread
From: Suvayu Ali @ 2014-10-21 16:15 UTC (permalink / raw)
  To: help-gnu-emacs

On Tue, Oct 21, 2014 at 06:34:03AM -0700, Mike wrote:
> On Tuesday, October 21, 2014 2:44:15 AM UTC-4, Suvayu Ali wrote:
> > 
> > Maybe you can try something like this in your init file:
> > 
> > ;; set PATH to use standalone texlive instead
> > 
> > (setenv "PATH" "/opt/texlive/2014/bin/x86_64-linux:$PATH" t)
> > 
> 
> Thank Suvayu for your reply.
> In fact, I am migrating from windows (and Code Block) to mac (and Emacs), so I am quite new to OS X 10.10 and Emacs.
> Could you please tell me how I can set the PATH as you said.
> Thank you.

What wrote above is emacs-lisp code which emacs understands.  So you
need to put that in your initialisation file.  Usually it is ~/.emacs,
if that is absent, ~/.emacs.d/init.el is used.  If on your system you do
not have the ~/.emacs file, just create a new one and the following line
(after modifying the path appropriately).

  (setenv "PATH" "/path/to/bin:$PATH" t)

So if you have gdb installed in /opt/local/bin, /path/to/bin should be
/opt/local/bin.

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
       [not found]     ` <mailman.11649.1413908125.1147.help-gnu-emacs@gnu.org>
@ 2014-10-21 19:24       ` Mike
  2014-10-21 19:38         ` Jacob Gerlach
                           ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Mike @ 2014-10-21 19:24 UTC (permalink / raw)
  To: help-gnu-emacs

Hello

I found the ~/.emacs file and edit it by adding the following line into it:
"(setenv "PATH" "/usr/local/bin:$PATH" t)"
since my gdb is located in /usr/local/bin

but when I run the emacs it gives me following error:
"Warning (initialization): An error occurred while loading `/Users/mike/.emacs':

End of file during parsing: /Users/mike/.emacs

To ensure normal operation, you should investigate and remove the
cause of the error in your initialization file.  Start Emacs with
the `--debug-init' option to view a complete error backtrace."

My whole ini file is as follows:
"(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(column-number-mode t))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
;; set PATH to use standalone texlive instead
(setenv "PATH" "/usr/local/bin:$PATH" t)"

Could you figure out what the problem is?
 
On Tuesday, October 21, 2014 12:15:12 PM UTC-4, Suvayu Ali wrote:
> On Tue, Oct 21, 2014 at 06:34:03AM -0700, Mike wrote:
> 
> > On Tuesday, October 21, 2014 2:44:15 AM UTC-4, Suvayu Ali wrote:
> 
> > > 
> 
> > > Maybe you can try something like this in your init file:
> 
> > > 
> 
> > > ;; set PATH to use standalone texlive instead
> 
> > > 
> 
> > > (setenv "PATH" "/opt/texlive/2014/bin/x86_64-linux:$PATH" t)
> 
> > > 
> 
> > 
> 
> > Thank Suvayu for your reply.
> 
> > In fact, I am migrating from windows (and Code Block) to mac (and Emacs), so I am quite new to OS X 10.10 and Emacs.
> 
> > Could you please tell me how I can set the PATH as you said.
> 
> > Thank you.
> 
> 
> 
> What wrote above is emacs-lisp code which emacs understands.  So you
> 
> need to put that in your initialisation file.  Usually it is ~/.emacs,
> 
> if that is absent, ~/.emacs.d/init.el is used.  If on your system you do
> 
> not have the ~/.emacs file, just create a new one and the following line
> 
> (after modifying the path appropriately).
> 
> 
> 
>   (setenv "PATH" "/path/to/bin:$PATH" t)
> 
> 
> 
> So if you have gdb installed in /opt/local/bin, /path/to/bin should be
> 
> /opt/local/bin.
> 
> 
> 
> Hope this helps,
> 
> 
> 
> -- 
> 
> Suvayu
> 
> 
> 
> Open source is the future. It sets us free.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
  2014-10-21 19:24       ` Mike
@ 2014-10-21 19:38         ` Jacob Gerlach
       [not found]         ` <mailman.11666.1413920348.1147.help-gnu-emacs@gnu.org>
  2014-10-22 17:25         ` John Mastro
  2 siblings, 0 replies; 16+ messages in thread
From: Jacob Gerlach @ 2014-10-21 19:38 UTC (permalink / raw)
  To: Mike; +Cc: help-gnu-emacs

On Tue, Oct 21, 2014 at 3:24 PM, Mike <mastali.mehrdad@gmail.com> wrote:

> ;; set PATH to use standalone texlive instead
> (setenv "PATH" "/usr/local/bin:$PATH" t)"
>

It looks like you have an unmatched " after the closing parenthesis.


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
       [not found]         ` <mailman.11666.1413920348.1147.help-gnu-emacs@gnu.org>
@ 2014-10-21 19:47           ` Mike
  2014-10-22 12:55             ` Mike
  0 siblings, 1 reply; 16+ messages in thread
From: Mike @ 2014-10-21 19:47 UTC (permalink / raw)
  To: help-gnu-emacs

Sorry to confuse you
but I tried to put the emacs output in "  " to make it clear
if you notice, there is another unmatched at the beginning.

Best


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
  2014-10-21 19:47           ` Mike
@ 2014-10-22 12:55             ` Mike
  0 siblings, 0 replies; 16+ messages in thread
From: Mike @ 2014-10-22 12:55 UTC (permalink / raw)
  To: help-gnu-emacs

Any ideas

Please


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
  2014-10-21 19:24       ` Mike
  2014-10-21 19:38         ` Jacob Gerlach
       [not found]         ` <mailman.11666.1413920348.1147.help-gnu-emacs@gnu.org>
@ 2014-10-22 17:25         ` John Mastro
  2014-10-22 17:29           ` John Mastro
  2 siblings, 1 reply; 16+ messages in thread
From: John Mastro @ 2014-10-22 17:25 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org; +Cc: Mike

Hi Mike,

Mike <mastali.mehrdad@gmail.com> wrote:
> Hello
>
> I found the ~/.emacs file and edit it by adding the following line into it:
> "(setenv "PATH" "/usr/local/bin:$PATH" t)"
> since my gdb is located in /usr/local/bin
>
> but when I run the emacs it gives me following error:
> "Warning (initialization): An error occurred while loading `/Users/mike/.emacs':

I tried evaluating the forms you posted and didn't have any errors, so
I'm not sure what's going on.

Try copying them into normal Emacs Lisp file (like ~/init-test.el) and
commenting them out in your init file. The restart Emacs, open the other
file you put them in, and evaluate each form one by one. To do that, put
your cursor right after the form and type C-x C-e (for
`eval-last-sexp'). Hopefully this will tell you which form is causing a
problem.

-- 
john



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
  2014-10-22 17:25         ` John Mastro
@ 2014-10-22 17:29           ` John Mastro
  0 siblings, 0 replies; 16+ messages in thread
From: John Mastro @ 2014-10-22 17:29 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org; +Cc: Mike

John Mastro <john.b.mastro@gmail.com> wrote:
> Try copying them into normal Emacs Lisp file (like ~/init-test.el) and
> commenting them out in your init file. The restart Emacs, open the other
> file you put them in, and evaluate each form one by one. To do that, put
> your cursor right after the form and type C-x C-e (for
> `eval-last-sexp'). Hopefully this will tell you which form is causing a
> problem.

The other thing you should try, if you haven't already, is starting
Emacs with --debug-init. For this, you want those forms to be in your
init file, and *not* commented out.

(I didn't mention this in the other message because I thought I
remembered that you already did it, but just scanned through the
messages and didn't see it. So just disregard if you have already done
it and I missed it.)

-- 
john



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
  2014-10-21  0:12 gdb emacs no such file or directory gdb Mike
  2014-10-21  6:44 ` Suvayu Ali
       [not found] ` <mailman.11612.1413873879.1147.help-gnu-emacs@gnu.org>
@ 2014-10-22 22:07 ` Mike
  2014-10-22 23:05   ` John Mastro
  2014-10-24  1:05 ` Mike
  3 siblings, 1 reply; 16+ messages in thread
From: Mike @ 2014-10-22 22:07 UTC (permalink / raw)
  To: help-gnu-emacs

Hi John

Thank you for your replies. But I do not want to find what is the problem with init file (because I know it is the last line that I added). The problem is running gdb by Emacs. Whenever I try to run gdb in Emacs by M-x gdb, first it says 

Run gdb (like this): gdb -i=mi myfile

and after pressing return it says that

searching for program: No such a file or directory, gdb

What should I do now. (keep in mind that I am new to the Emacs)

Best Regard

On Monday, October 20, 2014 8:12:59 PM UTC-4, Mike wrote:
> Hi guys,
> 
> I have just decided to use Emacs and GDB for my FORTRAN coding. Everything seem to work perfectly, but the GDB and Emacs integration. I know GDB is working fine since I can operate it in terminal, but as soon as I try to use it in Emacs I get "no such file or directory gdb".
> 
> This problem is probably related to disagreement between the PATH in a shell and my Emacs exec-path as already discussed in  https://groups.google.com/forum/#!topic/gnu.emacs.help/WkjoK2L57rE.
> 
> Unfortunately, I do not know how to set the PATH in Emacs. However, I tried the following from above link that did not work:
> "There is also a way to launch GNU Emacs from the Terminal (has the correct path) à la: 
> 
>         open /Applications/Emacs.app 
> 
> Then it will inherit $PATH's value and set exec-path accordingly. (Mac OS X misses some understanding of setting paths on an UNIX system.) 
> "
> 
> Does any one know how can I solve the problem?
> 
> Any help on this would be much appreciated. 
> Kind regards 
> 
> Mike


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
  2014-10-22 22:07 ` Mike
@ 2014-10-22 23:05   ` John Mastro
  0 siblings, 0 replies; 16+ messages in thread
From: John Mastro @ 2014-10-22 23:05 UTC (permalink / raw)
  To: Mike; +Cc: help-gnu-emacs@gnu.org

Mike <mastali.mehrdad@gmail.com> wrote:
> Thank you for your replies. But I do not want to find what is the problem with init file (because I know it is the last line that I added). The problem is running gdb by Emacs. Whenever I try to run gdb in Emacs by M-x gdb, first it says
>
> Run gdb (like this): gdb -i=mi myfile
>
> and after pressing return it says that
>
> searching for program: No such a file or directory, gdb

Well, the bottom line is that you probably want to have these two forms
in your init file:

    (setenv "PATH" "/usr/local/bin:$PATH" t)
    (add-to-list 'exec-path "/usr/local/bin")

Alternatively, you could just install the `exec-path-from-shell' package
from MELPA and add this to your init file:

    (exec-path-from-shell-initialize)

However, my impression is that the thing blocking these solutions at the
moment is a mysterious error in your init file.

Based on the error ("end of file while reading"), it sounds like you
have a mismatched quote/paren/bracket somewhere. But nothing's
mismatched in what you posted, so it's hard to be specific.

--
john



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: gdb emacs no such file or directory gdb
  2014-10-21  0:12 gdb emacs no such file or directory gdb Mike
                   ` (2 preceding siblings ...)
  2014-10-22 22:07 ` Mike
@ 2014-10-24  1:05 ` Mike
  3 siblings, 0 replies; 16+ messages in thread
From: Mike @ 2014-10-24  1:05 UTC (permalink / raw)
  To: help-gnu-emacs

Hello

I found a solution for my problem by copying the following to mu ~/.emacs file

(add-to-list 'load-path "~/elisp")
(require 'exec-path-from-shell)

(when (memq window-system '(mac ns))
  (exec-path-from-shell-initialize))

where exec-path-from-shell is a .el file that someone has written to copy the path files from the shell.

By doing this the Emacs can run the gdb. However, when I want to run a code using gdb in emacs, it is very slow and most of the time emacs crashes and I have to force quit.

Any idea?


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-10-24  1:05 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-21  0:12 gdb emacs no such file or directory gdb Mike
2014-10-21  6:44 ` Suvayu Ali
     [not found] ` <mailman.11612.1413873879.1147.help-gnu-emacs@gnu.org>
2014-10-21 13:34   ` Mike
2014-10-21 16:15     ` Suvayu Ali
     [not found]     ` <mailman.11649.1413908125.1147.help-gnu-emacs@gnu.org>
2014-10-21 19:24       ` Mike
2014-10-21 19:38         ` Jacob Gerlach
     [not found]         ` <mailman.11666.1413920348.1147.help-gnu-emacs@gnu.org>
2014-10-21 19:47           ` Mike
2014-10-22 12:55             ` Mike
2014-10-22 17:25         ` John Mastro
2014-10-22 17:29           ` John Mastro
2014-10-22 22:07 ` Mike
2014-10-22 23:05   ` John Mastro
2014-10-24  1:05 ` Mike
  -- strict thread matches above, loose matches on Subject: below --
2014-01-16  4:38 Rob Kinsey
2014-01-16 12:34 ` Tim Visher
2014-01-16 19:51 ` Peter Dyballa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.