Re: [RFC/dwarf-2] Add support for included files

Jim Blandy
2004-05-01T04:57:54Z

Joel Brobecker <brobecker@gnat.com> writes:
> > - Is it really okay to pass NULL to dwarf_decode_lines for comp_dir?
> > Won't the filenames of the partial symbol tables be different from
> > those of the symbol tables? To fix this, read_partial_die would
> > have to check for DW_AT_comp_dir attributes, too.
>
> I don't think we need to worry about the comp_dir when building
> the psymtabs for included files. The filename used for the psymtab
> is the same as the filename used to build the symtab (checked it
> by inspecting start_subfile() and end_symtab()). The only thing
> we could gain from computing the comp_dir as well during that phase
> is to compute the psymtab fullname. But then comp_dir is used
> to set the symtab dirname, not to compute the fullname. So it doesn't
> help improve the consistency between psymtab and symtab.

Let me make sure I've got it right. When we're calling
dwarf_decode_lines for the partial symbol tables, we never call
dwarf2_start_subfile anyway --- that's for building full symbol tables
--- so the use of 'dirname' in that function doesn't matter. And
since it's never used to compute the full name of the symtabs, it
doesn't introduce inconsistencies to omit it.

If that's correct, then this patch is ready to commit. Thanks very
much!