From: Daniel Jacobowitz <drow@false.org>
To: Aleksandar Ristovski <ARistovski@qnx.com>
Cc: dje@google.com, gdb-patches@sourceware.org
Subject: Re: [RFA] patch for DW_AT_comp_dir/DW_AT_name vs .debug_line inco nsistencies
Date: Tue, 08 Jan 2008 16:46:00 -0000 [thread overview]
Message-ID: <20080108164544.GA25831@caradoc.them.org> (raw)
In-Reply-To: <2F6320727174C448A52CEB63D85D11F40A62@nova.ott.qnx.com>
On Tue, Jan 08, 2008 at 11:33:28AM -0500, Aleksandar Ristovski wrote:
>
>
> > -----Original Message-----
> > From: Daniel Jacobowitz [mailto:drow@false.org]
> > Sent: January 8, 2008 11:19 AM
> > To: Aleksandar Ristovski
> > Cc: dje@google.com; gdb-patches@sourceware.org
> > Subject: Re: [RFA] patch for DW_AT_comp_dir/DW_AT_name vs .debug_line inco
> > nsistencies
> >
> > 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 recreated your case.
> My physical path:
>
> My compiler generated this:
> DW_AT_name : ../main.cc>~~~~$
> DW_AT_comp_dir : /foo/bar/obj>~~~~
> (note how it stored symlink in comp_dir)
> The Directory Table:$
> ..$
> $
> The File Name Table:$
> Entry>Dir>~~~~Time>~~~Size>~~~Name$
> 1>~~~~1>~~~~~~0>~~~~~~0>~~~~~~main.cc$
>
>
> I still don't see the issue. The mere fact that my /foo/bar/main.cc does not
> really live there but rather in /foo/bar/real-obj doesn't make any
> difference for resolving debug_info and debug_line information. Gcc thought
> it was there, that should be good enough for gdb.
The above line table will never provoke the bug that we have been
discussing. You have "/foo/bar/obj" as the compilation directory.
In .debug_info you have "../main.cc" appended to that. In .debug_line
you have ".." and "main.c" appended to it. GDB will get the same
result from both.
Your original example had
"c:/QNXTau/eclipse/ide-4.5-workspace/testManagedCC/main.cc" for the
name, "c:/QNXTau/eclipse/ide-4.5-workspace/testManagedCC/Debug" for
the compilation directory, and ".." and "main.c" in .debug_line.
So .debug_info said
"c:/QNXTau/eclipse/ide-4.5-workspace/testManagedCC/main.cc" and
.debug_line said
"c:/QNXTau/eclipse/ide-4.5-workspace/testManagedCC/Debug/../main.cc".
If there had been a symlink involved, those would have been different
files; they are different paths.
The compiler should never do this. I still say that this is a bug in
the compiler. Does a more recent version of GCC still do so? GCC
3.3.5 predates an official FSF port to native Windows.
--
Daniel Jacobowitz
CodeSourcery
next prev parent reply other threads:[~2008-01-08 16:46 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-08 16:34 Aleksandar Ristovski
2008-01-08 16:46 ` Daniel Jacobowitz [this message]
-- strict thread matches above, loose matches on Subject: below --
2008-04-09 14:55 Aleksandar Ristovski
2008-04-09 20:52 ` Doug Evans
2008-04-08 16:37 Aleksandar Ristovski
2008-01-08 21:51 Aleksandar Ristovski
2008-01-08 21:57 ` Daniel Jacobowitz
2008-01-08 21:26 Aleksandar Ristovski
2008-01-08 21:24 Aleksandar Ristovski
2008-01-08 21:32 ` Daniel Jacobowitz
2008-01-08 20:28 Aleksandar Ristovski
2008-01-08 20:33 ` Daniel Jacobowitz
2008-01-08 16:10 Aleksandar Ristovski
2008-01-08 16:19 ` Daniel Jacobowitz
2008-01-08 17:33 ` Doug Evans
2008-01-06 6:44 Aleksandar Ristovski
2008-01-06 18:44 ` Doug Evans
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080108164544.GA25831@caradoc.them.org \
--to=drow@false.org \
--cc=ARistovski@qnx.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox