all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* gdb hangs in Emacs 23.2.1  (Mac OSX 10.6.3)
@ 2011-02-04 21:37 Dylan
  2011-02-05 10:24 ` Peter Dyballa
       [not found] ` <mailman.2.1296901461.7938.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Dylan @ 2011-02-04 21:37 UTC (permalink / raw)
  To: help-gnu-emacs

I cannot get gdb to work under Emacs 23.2.1 (neither in the GNU
command line version or Cocoa Emacs). Each time I run gdb under emacs
and then execute a command with 'RETURN', the prompt just sits there.
The version of gdb that is being executed under emacs is:
6.3.50-20050815 (Apple version gdb-1344).

So I figured I would try the latest version of gdb (7.1) as a
workaround, and installed it successfully via MacPorts. But am unable
to get emacs to recognize the executable file (fsf-gdb). I suspect
there is something wrong with my code/I am using the wrong commands.

I put the following in my .emacs, none of which worked (emacs doesn't
recognize fsf-gdb after M-x) :

(setq exec-path (append exec-path '("/opt/local/bin/fsf-
gdb")))
(add-to-list 'load-path "opt/local/share/gdb/syscalls")
(require 'fsf-gdb)

What am I missing here? And why might the Apple's version of gdb hang
in emacs (it works just fine in terminal)?

Thanks


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

* Re: gdb hangs in Emacs 23.2.1  (Mac OSX 10.6.3)
  2011-02-04 21:37 gdb hangs in Emacs 23.2.1 (Mac OSX 10.6.3) Dylan
@ 2011-02-05 10:24 ` Peter Dyballa
       [not found] ` <mailman.2.1296901461.7938.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2011-02-05 10:24 UTC (permalink / raw)
  To: Dylan; +Cc: help-gnu-emacs


Am 04.02.2011 um 22:37 schrieb Dylan:

> I cannot get gdb to work under Emacs 23.2.1 (neither in the GNU
> command line version or Cocoa Emacs). Each time I run gdb under emacs
> and then execute a command with 'RETURN', the prompt just sits there.
> The version of gdb that is being executed under emacs is:
> 6.3.50-20050815 (Apple version gdb-1344).


With exactly this version of gdb I recently was successfully debugging  
the X client version of GNU Emacs 24.0.50 – on Leopard, Mac OS X 10.5.8.

Gdb is accessible in GNU Emacs, and I think since 23.x, under the  
Grand Unified Debugger, gud. Lookup documentation under gud.

I prefer not to set exec-path, I just set the right PATH for the  
environment in which the applications run. This can be done with  
~/.MacOSX/environment.plist. Once the utility/programme is found by  
Emacs it should be able to find its own particles.

http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/EnvironmentVars.html
http://www.astro.washington.edu/users/rowen/AquaEnvVar.html

--
Greetings

   Pete

Cabbage, n. A familiar kitchen-garden vegetable about as large and  
wise as a man's head.




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

* Re: gdb hangs in Emacs 23.2.1 (Mac OSX 10.6.3)
       [not found] ` <mailman.2.1296901461.7938.help-gnu-emacs@gnu.org>
@ 2011-02-07 19:28   ` Dylan
  2011-02-07 23:10     ` Peter Dyballa
       [not found]     ` <mailman.4.1297120219.8034.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Dylan @ 2011-02-07 19:28 UTC (permalink / raw)
  To: help-gnu-emacs

> With exactly this version of gdb I recently was successfully debugging  
> the X client version of GNU Emacs 24.0.50 – on Leopard, Mac OS X 10.5.8.
>
> Gdb is accessible in GNU Emacs, and I think since 23.x, under the  
> Grand Unified Debugger, gud. Lookup documentation under gud.

Thanks, I tried running "gud-gdb" instead of "gdb" in Emacs and now
this version seems to work.

> I prefer not to set exec-path, I just set the right PATH for the  
> environment in which the applications run. This can be done with  
> ~/.MacOSX/environment.plist. Once the utility/programme is found by  
> Emacs it should be able to find its own particles.

I tried modifying my environment.plist file, but I still can't manage
to get either Terminal or Cocoa Emacs to recognize the fsf-gdb
executable (located in /opt/local). This is what I have in my
environment.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://
www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>PATH</key>
  <string>/bin:/sbin:/usr:/opt/local:/Users/Dylan/Library/Application
Support/SuperCollider:/Applications/SuperCollider</string>
  <key>PYTHONPATH</key>
  <string>/Library/Frameworks/Python.framework/Versions/2.7/bin</
string>
</dict>
</plist>

Perhaps I am missing something here? Am I missing something?




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

* Re: gdb hangs in Emacs 23.2.1 (Mac OSX 10.6.3)
  2011-02-07 19:28   ` Dylan
@ 2011-02-07 23:10     ` Peter Dyballa
       [not found]     ` <mailman.4.1297120219.8034.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2011-02-07 23:10 UTC (permalink / raw)
  To: Dylan; +Cc: help-gnu-emacs


Am 07.02.2011 um 20:28 schrieb Dylan:

>  <key>PATH</key>
>  <string>/bin:/sbin:/usr:/opt/local:/Users/Dylan/Library/Application
> Support/SuperCollider:/Applications/SuperCollider</string>
>
> Perhaps I am missing something here? Am I missing something?


Not you, but PATH: it misses a) sequence and b) bin directories.

If you want an UNIX system find a particular version of an executable  
*before* its other version, then you set the first version's path  
*before* that of the second version. So MacPorts's /opt/local/bin  
should come early (usually it is set first in your login shell's RC  
file) in PATH. And you need to exactly name the complete path to  
executable, i.e., /opt/local/bin, because in /opt/local/bin the other  
gdb is located.

After changes in ~/.MacOSX/environment.plist you need to log off and  
in again to have them valid. (No MS reboot.) You do not need MANPATH?


PATH=/opt/local/bin:/opt/local/sbin:/Users/pete/bin:/usr/local/texlive/ 
2010/bin/universal-darwin:/Developer/usr/bin:/usr/bin:/bin:/sbin:/usr/ 
sbin:/usr/local/bin:/usr/X11/bin:/Developer/Tools


--
Greetings

   Pete

One-Shot Case Study, n.:
	The scientific equivalent of the four-leaf clover, from which it is  
concluded all clovers possess four leaves and are sometimes green.




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

* Re: gdb hangs in Emacs 23.2.1 (Mac OSX 10.6.3)
       [not found]     ` <mailman.4.1297120219.8034.help-gnu-emacs@gnu.org>
@ 2011-02-09  0:48       ` Dylan
  2011-02-09  9:53         ` Peter Dyballa
       [not found]         ` <mailman.0.1297245224.21406.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Dylan @ 2011-02-09  0:48 UTC (permalink / raw)
  To: help-gnu-emacs


> If you want an UNIX system find a particular version of an executable  
> *before* its other version, then you set the first version's path  
> *before* that of the second version. So MacPorts's /opt/local/bin  
> should come early (usually it is set first in your login shell's RC  
> file) in PATH. And you need to exactly name the complete path to  
> executable, i.e., /opt/local/bin, because in /opt/local/bin the other  
> gdb is located.
>
> After changes in ~/.MacOSX/environment.plist you need to log off and  
> in again to have them valid. (No MS reboot.) You do not need MANPATH?
>
> PATH=/opt/local/bin:/opt/local/sbin:/Users/pete/bin:/usr/local/texlive/
> 2010/bin/universal-darwin:/Developer/usr/bin:/usr/bin:/bin:/sbin:/usr/
> sbin:/usr/local/bin:/usr/X11/bin:/Developer/Tools

I updated my environment.plist file to look like this:


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://
www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>PATH</key>
  <string>/opt/local/bin:/opt/local/sbin:/usr/bin:/usr/sbin:/usr/local/
bin:/Developer/Tools:/Developer/usr/bin:</string>
  <key>MANPATH</key>
  <string>/usr/X11/share/man:/usr/local/share/man:/Users/Dylan/man:/
Developer/usr/X11/share/man/man3</string>
  <key>PYTHONPATH</key>
  <string>/Library/Frameworks/Python.framework/Versions/2.7/bin</
string>
  <key>SuperCollider</key>
  <string>/Users/Dylan/Library/Application Support/SuperCollider:/
Applications/SuperCollider</string>
</dict>
</plist>

Yet I still can't get Emacs to locate fsf-gdb (in /opt/local/bin).
Just to make sure I am not missing something, here is what I have in
my .bash_profile:

PATH="$PATH:/Users/Dylan/Library/Application Support/SuperCollider"
export PATH

PATH="$PATH:/Applications/SuperCollider"
export PATH

PATH="$PATH:/usr/share/TargetConfigs/bin"
export PATH

# Setting PATH for Java
export PATH=/usr/bin/java:$PATH

# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

# MacPorts Installer addition on 2010-07-28_at_22:39:20: adding an
appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with
MacPorts.

When I type the command echo $PATH in Terminal, this is what comes
back:

/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/
Versions/2.7/bin:/usr/bin/java:/usr/bin:/bin:/usr/sbin:/sbin:/usr/
local/bin:/usr/X11/bin:/opt/local/bin:/opt/local/sbin:/Developer/
Tools:/Developer/usr/bin:/Users/Dylan/Library/Application Support/
SuperCollider:/Applications/SuperCollider:/usr/share/TargetConfigs/bin

Any other ideas??

Thanks,
Dylan



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

* Re: gdb hangs in Emacs 23.2.1 (Mac OSX 10.6.3)
  2011-02-09  0:48       ` Dylan
@ 2011-02-09  9:53         ` Peter Dyballa
       [not found]         ` <mailman.0.1297245224.21406.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2011-02-09  9:53 UTC (permalink / raw)
  To: Dylan; +Cc: help-gnu-emacs


Am 09.02.2011 um 01:48 schrieb Dylan:

> Any other ideas??

Yes.

1.) Don't repeat in ~/.bash_profile what you've set in ~/.MacOSX/ 
environment.plist! Better use cleverly:

	PATH=`defaults read "${HOME}/.MacOSX/environment" PATH`

or, if you really (why?) need to alter the default value from  
~/.MacOSX/environment.plist:

	PATH=/Whatever:/else:`defaults read "${HOME}/.MacOSX/environment" PATH`

Shells in whatever tools inherit from your login environment which in  
turn is set by  ~/.MacOSX/environment.plist. Their RC files can be  
kept simple and basic. (Try it, if you don't believe.)

2.) Bash is a beast that has a few too many modes of mixed operation  
(interactive, login, ...). Additional setup has to be done exactly for  
this targeted mode.

3.) In Emacs you can check its process environment by two means. In  
*scratch* buffer you can execute this Lisp and similar code:

	(getenv "PATH")

or invoke in *shell* buffer a UNIX command like this:

	ps -lwwwxE | egrep UID\|Emacs | grep -v grep

It will list the environment of a process that has in its name the  
word "Emacs", with a capital E. So you can learn from this where Emacs  
searches for binaries, for example.

4.) You can also invoke:

	M-x shell-command RET which <name of fsf-gdb binary> RET

and in echo-area the path-name will appear. If not, than something is  
wrong. Than you can start debugging by adding to your login shell's RC  
files (best all) lines like:

	echo "Hello! My name is <appropriate file name>."

and see which is executed when you perform shell-command.

5.) What is GUD/GDB documentation telling you about the name of the  
gdb executable? Is it fixed or is set to some value by a variable?  
I've seen a

	(defcustom gud-gud-gdb-command-name "gdb --fullname"

... which could explain why a name "fsf-gdb" would never be found.

--
Greetings

   Pete

"What do you think of Western Civilisation?"
"I think it would be a good idea!"
				– Mohandas Karamchand Gandhi




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

* Re: gdb hangs in Emacs 23.2.1 (Mac OSX 10.6.3)
       [not found]         ` <mailman.0.1297245224.21406.help-gnu-emacs@gnu.org>
@ 2011-02-09 20:30           ` Dylan
  2011-02-10 23:26             ` Peter Dyballa
                               ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Dylan @ 2011-02-09 20:30 UTC (permalink / raw)
  To: help-gnu-emacs

> 1.) Don't repeat in ~/.bash_profile what you've set in ~/.MacOSX/
> environment.plist! Better use cleverly:
>
>         PATH=`defaults read "${HOME}/.MacOSX/environment" PATH`

OK. Took care of that. The shell seems to be recognizing the correct
PATH this time around.

> 3.) In Emacs you can check its process environment by two means. In  
> *scratch* buffer you can execute this Lisp and similar code:
>
>         (getenv "PATH")

Checked this as well - it agrees with the PATH I established in the
environment.plist file.

> 4.) You can also invoke:
>
>         M-x shell-command RET which <name of fsf-gdb binary> RET
>

After invoking this in Emacs, it did indeed echo the correct path to
the fsf-gdb executable.

> 5.) What is GUD/GDB documentation telling you about the name of the  
> gdb executable? Is it fixed or is set to some value by a variable?  
> I've seen a
>
>         (defcustom gud-gud-gdb-command-name "gdb --fullname"
>
> ... which could explain why a name "fsf-gdb" would never be found.
>

Yes, it does seem to be set to some variable. After reading the gdb
documentation, when Emacs opens
gdb as a sub-routine it apparently opens it with the option "-f", the
fullname option. I am not sure how to
change this behavior in Emacs.

I think I am getting really close!

Thanks,
Dylan


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

* Re: gdb hangs in Emacs 23.2.1 (Mac OSX 10.6.3)
  2011-02-09 20:30           ` Dylan
@ 2011-02-10 23:26             ` Peter Dyballa
  2011-02-11 13:55             ` Peter Dyballa
       [not found]             ` <mailman.0.1297381915.13481.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2011-02-10 23:26 UTC (permalink / raw)
  To: Dylan; +Cc: help-gnu-emacs


Am 09.02.2011 um 21:30 schrieb Dylan:

> After reading the gdb documentation, when Emacs opens gdb as a sub- 
> routine it apparently opens it with the option "-f", the fullname  
> option. I am not sure how to change this behavior in Emacs.


I think my work is done now. With details in GUD/gdb I can't help.  
Using it too seldom. One question: Why do you need this FSF gdb? Is  
really well integrated into Mac OS X as it is the case with gdb which  
comes with Mac OS X?

--
Greetings

   Pete

You can learn many things from children.  How much patience you have,  
for instance.
				– Franklin P. Jones




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

* Re: gdb hangs in Emacs 23.2.1 (Mac OSX 10.6.3)
  2011-02-09 20:30           ` Dylan
  2011-02-10 23:26             ` Peter Dyballa
@ 2011-02-11 13:55             ` Peter Dyballa
       [not found]             ` <mailman.0.1297381915.13481.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2011-02-11 13:55 UTC (permalink / raw)
  To: Dylan; +Cc: help-gnu-emacs


Am 09.02.2011 um 21:30 schrieb Dylan:

> I think I am getting really close!


Finally open the Options menu, select "Customize Emacs" and then  
choose "Groups Matching Regexp…" Now enter in mini-buffer gud RET and  
you'll see where you can reach your aim!

--
Greetings

   Pete

A lot of people mistake a short memory for a clear conscience.
				– Doug Larson




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

* Re: gdb hangs in Emacs 23.2.1 (Mac OSX 10.6.3)
       [not found]             ` <mailman.0.1297381915.13481.help-gnu-emacs@gnu.org>
@ 2011-02-11 20:11               ` Dylan
  0 siblings, 0 replies; 10+ messages in thread
From: Dylan @ 2011-02-11 20:11 UTC (permalink / raw)
  To: help-gnu-emacs

Thanks for all of your help, Pete! To address your question:

> I think my work is done now. With details in GUD/gdb I can't help.  
> Using it too seldom. One question: Why do you need this FSF gdb? Is  
> really well integrated into Mac OS X as it is the case with gdb which  
> comes with Mac OS X?

I also have a netbook running linux and fsf-gdb 7.1 is the one i am
using there.
Just wanted to be working with the same debugger since I move from my
netbook to my
desktop frequently.

But, I see that your last bit of information works! I now have fsf-gdb
up and running in Emacs!

Best,
Dylan




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

end of thread, other threads:[~2011-02-11 20:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-04 21:37 gdb hangs in Emacs 23.2.1 (Mac OSX 10.6.3) Dylan
2011-02-05 10:24 ` Peter Dyballa
     [not found] ` <mailman.2.1296901461.7938.help-gnu-emacs@gnu.org>
2011-02-07 19:28   ` Dylan
2011-02-07 23:10     ` Peter Dyballa
     [not found]     ` <mailman.4.1297120219.8034.help-gnu-emacs@gnu.org>
2011-02-09  0:48       ` Dylan
2011-02-09  9:53         ` Peter Dyballa
     [not found]         ` <mailman.0.1297245224.21406.help-gnu-emacs@gnu.org>
2011-02-09 20:30           ` Dylan
2011-02-10 23:26             ` Peter Dyballa
2011-02-11 13:55             ` Peter Dyballa
     [not found]             ` <mailman.0.1297381915.13481.help-gnu-emacs@gnu.org>
2011-02-11 20:11               ` Dylan

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.