This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] patch for DW_AT_comp_dir/DW_AT_name vs .debug_line inco nsistencies
- From: Daniel Jacobowitz <drow at false dot org>
- To: Aleksandar Ristovski <ARistovski at qnx dot com>
- Cc: dje at google dot com, gdb-patches at sourceware dot org
- Date: Tue, 8 Jan 2008 11:18:59 -0500
- Subject: Re: [RFA] patch for DW_AT_comp_dir/DW_AT_name vs .debug_line inco nsistencies
- References: <2F6320727174C448A52CEB63D85D11F40A5E@nova.ott.qnx.com>
On Tue, Jan 08, 2008 at 11:09:18AM -0500, Aleksandar Ristovski wrote:
> b) Symlinks involved:
> b1) Then I tried to make a symlink to another location:
> ln -s /tmp /foo/bar/obj
> Make /foo/bar/obj my work dir and try:
> gcc ../main.cc
> It fails to find it (and rightfully so).
> The only way I could build it is by using the absolute names.
> gcc -c -g /foo/bar/main.cc -o main.o
> now DW_AT_comp_dir is not specified and all paths are absolute (so no
> problems there).
No, try:
mkdir -p /foo/bar/real-obj/obj
touch /foo/bar/real-obj/main.c
rm /foo/bar/obj
ln -s /foo/bar/real-obj/obj /foo/bar/obj
cd /foo/bar/obj
gcc ../main.c
The path "/foo/bar/obj/../main.c" is valid. The path
"/foo/bar/main.c" is not.
I think we should not implement this unless we have a real-world
example where it would be necessary. It would require a version of
the compiler which outputs different paths in .debug_info and
.debug_line for the same file (which is a bug in the compiler, in my
opinion!), a Makefile using ".." to find source files, and a source
file including another file with the same basename.
--
Daniel Jacobowitz
CodeSourcery