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: "Doug Evans" <dje at google dot com>
- To: "Aleksandar Ristovski" <ARistovski at qnx dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 8 Jan 2008 09:32:40 -0800
- Subject: Re: [RFA] patch for DW_AT_comp_dir/DW_AT_name vs .debug_line inco nsistencies
- References: <2F6320727174C448A52CEB63D85D11F40A5E@nova.ott.qnx.com>
On Jan 8, 2008 8:09 AM, Aleksandar Ristovski <ARistovski@qnx.com> wrote:
> About normalize_path: I am really missing how would symlink spoil anything.
As a data point, here is an example that doesn't use #line, uses
present day gcc, and would cause bad behaviour in gdb if
normalize_path was indescriminately used. To what extent the example
is contrived and wouldn't occur in practice I don't know.
[The use of an obj directory here isn't important, it's just a turd
from various experiments.]
rm -rf /tmp/foo
mkdir -p /tmp/foo
cd /tmp/foo
mkdir -p a/b
ln -s a/b t
mkdir obj
cat >a/foo.c <<EOF
int x;
EOF
cat >a/b/foo.c <<EOF
#include "../foo.c"
int foo(){return x;}
EOF
cat >foo.c <<EOF
#include "t/foo.c"
int main (){return foo();}
EOF
cat foo.c
(cd obj && gcc -g /tmp/foo/foo.c -o ../foo.x)
readelf -w foo.x >foo.w
>From foo.w:
DW_AT_name : /tmp/foo/foo.c
The Directory Table:
/tmp/foo/t
/tmp/foo
/tmp/foo/t/..
The File Name Table:
Entry Dir Time Size Name
1 1 0 0 foo.c
2 2 0 0 foo.c
3 3 0 0 foo.c