bug#3650: M-x gdb unusable on Windows

[email protected] (Nick Roberts)
Newsgroups gmane.emacs.bugs,gmane.emacs.pretest.bugs
Message-ID <[email protected]>
Kenichi Handa writes:
 > In article <[email protected]>, Jason Rumney <[email protected]> writes:
 > 
 > > Problem 1 is that the default directory of gdb is the directory where 
 > > the Emacs executable is even though I started it from the source 
 > > directory and specified oo/i386/emacs.exe as the executable to debug. 
 > > This means that .gdbinit needs to be "source"d in manually.
 > 
 > It seems that this problem is not specific to Windows.  On
 > GNU/Linux, to debug a program compiled using libtool, I have
 > to to debug ./.libs/PROGNAME.  In that case, even if the
 > current directory has .gdbinit, it is not loaded in the gdb
 > session because gdb starts with the directory ./.libs.

You can change the behaviour to keep the current directory by setting
gud-chdir-before-run to nil.  The problem with this arrangement is that it
might not find your .gdbinit file (as with Emacs) and it's generally less
obvious what the default directory is in Emacs than what the current
working directory is from the command line.

Dan might find it "extremely annoying" but this change goes back to
2001-05-24 when gud.el was in the lisp directory.

I quite like this default and suggest keeping it, but it might be a good
idea to document the variable gud-chdir-before-run in the manual.

-- 
Nick                                           http://www.inet.net.nz/~nickrob
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.