* gdb does not honor default-directory
@ 2002-10-14 20:00 Matt Armstrong
0 siblings, 0 replies; only message in thread
From: Matt Armstrong @ 2002-10-14 20:00 UTC (permalink / raw)
This bug report will be sent to the Free Software Foundation,
not to your local site managers!
Please write in English, because the Emacs maintainers do not have
translators to read other languages for them.
Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.
In GNU Emacs 21.2.1 (i386-debian-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2002-03-22 on raven, modified by Debian
configured using `configure i386-debian-linux-gnu --prefix=/usr --sharedstatedir=/var/lib --libexecdir=/usr/lib --localstatedir=/var/lib --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes --with-x=yes --with-x-toolkit=athena --without-gif'
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: C
locale-coding-system: nil
default-enable-multibyte-characters: t
Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
When running gdb from gud in a directory where default-directory does
not equal what the getcwd() call returns for the same directory, gdb's
idea of $cwd will not be the same as emacs' idea of default-directory.
This can happen when you use symlinks. The end result is that files
stepped into or otherwise accessed via gdb are referenced by their
true name and not the preferred symlink name, which tends to confuse
tags and some source code control systems.
To keep gdb's idea of the current directory the same as emacs', I
think emacs should be passing "-cd default-directory" to gdb. This
should happen after the gud-chdir-before-run variable has had its
effect.
I currently get this done with the following advice:
(defadvice gud-gdb-massage-args (around my-gud-gdb-massage-args)
(setq ad-return-value
(append (ad-get-arg 1)
(list "-cd" default-directory))))
(eval-after-load "gdb" '(ad-activate 'gud-gdb-massage-args))
But I suggest the stock gud-gdb-massage-args be changed to something
like this (pardon my elisp):
(defun gud-gdb-massage-args (file args)
(append (cons "-fullname" args)) (list "-cd" default-directory))
gdb 5.2 ignores all but the first -cd arg, so appending it lets the
user specify a different dir if they like.
As a result, I get this:
Current directory is ~/dp/bordeaux1/
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
[...]
This GDB was configured as "sparc-sun-solaris2.6"...
(gdb) pwd
Working directory /users/maarmstr/dp/bordeaux1
(canonically /u2/maarmstr/dp/bordeaux1).
(gdb)
whereas before gdb's idea of current directory was the same as the
return value of the getcwd() call (/u2/maarmstr/dp/bordeaux1).
Recent input:
C-p C-n C-n C-n C-n C-n C-n C-x 2 C-x o C-x b e m a
c s <return> C-g C-x C-f C-g <help-echo> <help-echo>
<help-echo> <down-mouse-1> <mouse-1> C-s a d - a c
t i v a t e C-s C-s C-s C-s <return> <help-echo> M-<
C-s C-s C-s <return> C-l C-n C-n C-n C-n C-n C-n C-n
C-p C-p C-p C-p C-n <down-mouse-1> <mouse-1> <double-down-mouse-1>
<mouse-movement> <mouse-movement> <mouse-movement>
<mouse-movement> <mouse-movement> <mouse-movement>
<mouse-movement> <mouse-movement> <mouse-movement>
<mouse-movement> <mouse-movement> <mouse-movement>
<mouse-movement> <mouse-movement> <mouse-movement>
<mouse-movement> <mouse-movement> <mouse-movement>
<mouse-movement> <mouse-movement> <mouse-movement>
<mouse-movement> <double-drag-mouse-1> <down-mouse-1>
<mouse-1> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <menu-bar> <help-menu> <report-emacs-b
ug>
Recent messages:
unzipping elisp-13.gz...done
unzipping elisp-12.gz...done
Mark saved where search started
unzipping elisp-13.gz...done
iswitchb-possible-new-buffer: Quit
Quit
Mark saved where search started
Mark set
Mark saved where search started
Loading emacsbug...done
--
matt
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-10-14 20:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-14 20:00 gdb does not honor default-directory Matt Armstrong
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).