summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2004-04-13 18:36:36 +0000
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>2004-04-13 18:36:36 +0000
commitb412a7c6a25d7fb5add5a5ae389d346086421bfc (patch)
tree131112fb273f307c5c0c3fd90740741668a896ee
parent9d7f97fef5ef306514f17fb4f18bd3ae336fdf5e (diff)
downloadgcc-b412a7c6a25d7fb5add5a5ae389d346086421bfc.tar.gz
2004-04-13 H.J. Lu <hongjiu.lu@intel.com>
PR debug/14919 From gcc-3_2-rhl8-branch: 2003-02-04 Jakub Jelinek <jakub@redhat.com> * dwarf2out.c (dwarf2out_finish): Add AT_comp_dir attribute even if input file name is absolute, but one of the includes is relative. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-3_3-branch@80648 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/dwarf2out.c16
2 files changed, 27 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2f5102f6143..52cc0a27bdf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2004-04-13 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR debug/14919
+
+ From gcc-3_2-rhl8-branch:
+ 2003-02-04 Jakub Jelinek <jakub@redhat.com>
+
+ * 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 <dpatel@apple.com>
PR 14467
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index af76e0c348a..afd02e27f84 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.