This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: handling of absolute source file paths (feature wish/implementation idea)
On Thu, Jan 22, 2004 at 07:22:06PM +0200, Eli Zaretskii wrote:
> > From: Gernot Hillier <gernot.hillier@siemens.com>
> > Date: Thu, 22 Jan 2004 16:01:14 +0100
> >
> > 3. Implement a new setting "source-absolute-prefix" (analog to the already
> > existing "solib-absolute-prefix") which allows the user to set a prefix for
> > given absolute source code paths.
>
> I like this suggestion the best. It does exactly what you need here:
> allow the source directory tree to be moved deeper in the hierarchy.
> Your other suggestion, searching the source path for relative file
> names, sounds like an ad-hoc hack to me.
Thinking about this some more... here are the rearrangements I find
myself needing.
1.
src/include/elf.h
src/bfd/elfarm-nabi.c
src/bfd/elf32-arm.h
obj/bfd/bfd.h
obj/bfd/elfarm-nabi.o:
compilation dir /blah/obj/bfd
path to source ../../src/bfd/elfarm-nabi.c
include flags -I. -I../../src/bfd -I../../src/include
I want to be able to issue one command and find elf32-arm.h,
elfarm-nabi.c, bfd.h, and elf.h. They all have relative paths, rooted
at compilation directory /blah/obj/bfd. It happens to have been moved
to /blah-backup/obj/bfd and /blah-backup/src/bfd.
2. Same as above, but /blah/src/configure instead of ../src/configure,
so files have paths /blah/src/bfd/elf32-arm.h but also ./bfd.h. Moved
to /blah-backup/obj/bfd again. So the absolute paths to headers are
wrong and they don't have a simple prefix. This is probably not
worth solving.
3. Similar to #2 is the situation Gernot described; the absolute path
for the compilation directory has gained a prefix. This is pretty
unnatural for me, because I do not mount my _entire_ root filesystem on
the target. So I have to create /mnt/opt/src on the target and mount
host:/opt/src there, instead of just mounting host:/opt/src on
target:/mnt. But this is not hard to do, just surprising. And it
avoids the problem in #2.
So I would like for the absolute prefix to be applied to both
compilation directories used for relative paths and directly to
absolute source paths, and I think that will make my life a little
easier debugging GDB :)
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer