This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
handling of absolute source file paths (feature wish/implementation idea)
- From: Gernot Hillier <gernot dot hillier at siemens dot com>
- To: gdb at sources dot redhat dot com
- Date: Thu, 22 Jan 2004 16:01:14 +0100
- Subject: handling of absolute source file paths (feature wish/implementation idea)
- Organization: Siemens AG
Hi!
We use gdb for host/target debugging. As some of our targets are rather big in
respect to memory/disk space/..., we prefer to use gdb via remote login on
the target instead of using gdbserver/gdb often.
Therefore, we mount the sources from the development hosts on the target. This
means in our environment that a source file, available on the host as /a/b/
c.cpp gets mounted on /mnt/a/b/c.cpp on the target.
Unfortunately, our make environment uses absolute paths when building our
projects.
Everything worked very nice with gdb 5.3 for us by logging on to the target,
changing to /mnt and starting gdb. gdb searched absolute source code paths
not only absolute, but also relative to all given paths.
But since we switched to gdb 6.0, the target gdb isn't able to find the source
files any more because absolute paths are only searched starting from /.
We identified the reason in this change of gdb/source.c:
Revision 1.39, Mon Jan 13 20:11:47 2003 UTC by drow
* source.c (openp): If the file does not exist don't necessarily
search the path.
(see http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/
source.c.diff?r1=1.38&r2=1.39&cvsroot=src for the patch)
Now we solved the problem for us by reverting this change but we would very
much like to remove this hack and see it solved cleanly in the mainline.
We would be happy to implement a patch and send it to you for inclusion, but I
wanted to hear what you think about our ideas before doing it.
I see three ways of resolving this issue currently:
1. Reverting the change in the mainline as we did. I currently can see no real
reason why this change was made but I think there was a reason. So I assume
you won't like it, do you?
2. Implement a new setting "source-absolute-search-mode" which - when enabled
switches back to the old behaviour and tries to find absolute paths
nevertheless also relative to all given paths.
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.
So what do you think about these ideas? Any other suggestions (besides that we
should change our make environment which is unfortunately not too easy)?
Many thanks in advance for your constructive feedback...
--
Bye,
Gernot Hillier
CT SE 2
Siemens AG, Mch P