From 644bbb494229517bb15aac97b50aa1bf1df7f00c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 13 Apr 2004 18:36:36 +0000 Subject: [PATCH] [multiple changes] 2004-04-13 H.J. Lu PR debug/14919 From gcc-3_2-rhl8-branch: 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. From-SVN: r80648 --- gcc/ChangeLog | 11 +++++++++++ gcc/dwarf2out.c | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2f5102f61436..52cc0a27bdf0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2004-04-13 H.J. Lu + + PR debug/14919 + + From gcc-3_2-rhl8-branch: + 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. + 2004-04-06 Devang Patel PR 14467 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index af76e0c348af..afd02e27f842 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -12735,6 +12735,22 @@ dwarf2out_finish (input_filename) limbo_die_node *node, *next_node; dw_die_ref die = 0; + if (get_AT (comp_unit_die, DW_AT_comp_dir) == NULL) + { + char *wd = getpwd (); + unsigned i; + + if (wd != NULL) + { + for (i = 1; i < file_table.in_use; i++) + if (file_table.table[i][0] != DIR_SEPARATOR) + { + add_AT_string (comp_unit_die, DW_AT_comp_dir, wd); + break; + } + } + } + /* Traverse the limbo die list, and add parent/child links. The only dies without parents that should be here are concrete instances of inline functions, and the comp_unit_die. We can ignore the comp_unit_die. -- 2.47.2