This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] Don't lose compilation directory in Dwarf2 line-tables
On 4/14/06, Frederic RISS <frederic.riss@st.com> wrote:
> > - Then, at the top of dwarf2_start_subfile, check if dirname is
> > relative, and if comp_dir is available, prepend comp_dir to it. At
> > this point, we know dirname is as absolute as it can be. Then proceed
> > as in the original unpatched code. (Watch out for allocation issues.)
>
> I don't think we should concat comp_dir and dirname. In my mind,
> comp_dir makes only sense as an 'independant' information. Or the other
> way around: dirname gives you information about your source tree
> structure, and you lose it by prepending comp_dir to it. Have you an
> objection to storing "dirname/filename" as filename and comp_dir as
> directory? Maybe this makes only sense when dirname is also relative
> like in the snippet that Jason posted. Once we agree on this part, I'll
> post an updated patch.
We agree that, when dirname is absolute, comp_dir shouldn't get used at all.
When dirname is relative, I guess we lose information by concatenating
it with comp_dir, but I don't see where we would ever use that
information. I think the filename passed to start_subfile should be
free of leading directory components; I believe this is necessary to
make things like "print 'foo.c'::x" work.