From: Jakub Jelinek Date: Tue, 4 Feb 2003 13:30:02 +0000 (+0100) Subject: dwarf2out.c (dwarf2out_finish): Add AT_comp_dir attribute even if input file name... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=79c758fbcf8494e1bfb33a42df55c6586e5ef04b;p=gcc.git dwarf2out.c (dwarf2out_finish): Add AT_comp_dir attribute even if input file name is absolute... * dwarf2out.c (dwarf2out_finish): Add AT_comp_dir attribute even if input file name is absolute, but one of the includes is relative. From-SVN: r62377 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 007c4dcee10..936a7620a92 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-02-04 Jakub Jelinek + + * dwarf2out.c (dwarf2out_finish): Add AT_comp_dir + attribute even if input file name is absolute, but one of the + includes is relative. + 2003-02-04 Joseph S. Myers * doc/gcc.texi, doc/gccint.texi, doc/gcov.texi, diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 64aac19c6eb..7f1418de522 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -12663,6 +12663,16 @@ dwarf2out_finish (input_filename) add_name_attribute (comp_unit_die, input_filename); if (input_filename[0] != DIR_SEPARATOR) add_comp_dir_attribute (comp_unit_die); + else if (get_AT (comp_unit_die, DW_AT_comp_dir) == NULL) + { + size_t i; + for (i = 1; i < VARRAY_ACTIVE_SIZE (file_table); i++) + if (VARRAY_CHAR_PTR (file_table, i)[0] != DIR_SEPARATOR) + { + add_comp_dir_attribute (comp_unit_die); + break; + } + } /* Traverse the limbo die list, and add parent/child links. The only dies without parents that should be here are concrete instances of