]> gcc.gnu.org Git - gcc.git/commitdiff
dwarf2out.c (output_file_names): Test new macro DWARF2_DIR_SHOULD_END_WITH_SEPARATOR.
authorDouglas B Rupp <rupp@gnat.com>
Tue, 28 Jul 2009 18:07:32 +0000 (18:07 +0000)
committerDouglas Rupp <rupp@gcc.gnu.org>
Tue, 28 Jul 2009 18:07:32 +0000 (18:07 +0000)
* dwarf2out.c (output_file_names): Test new macro
DWARF2_DIR_SHOULD_END_WITH_SEPARATOR.
(add_comp_dir_attribute): Likewise.

From-SVN: r150173

gcc/ChangeLog
gcc/dwarf2out.c

index cd29b148d6e18379aa175942aa0a17812958138f..f337538a52b934b9f20b1e5af9f496319b1c4eed 100644 (file)
@@ -1,3 +1,9 @@
+2009-07-28  Douglas B Rupp  <rupp@gnat.com>
+
+       * dwarf2out.c (output_file_names): Test new macro
+       DWARF2_DIR_SHOULD_END_WITH_SEPARATOR.
+       (add_comp_dir_attribute): Likewise.
+
 2009-07-28  Kai Tietz  <kai.tietz@onevision.com>
 
        * config/i386/mingw-w64.h (LINK_SPEC): Add
index d3ed637e3796183c82d6cd59874959ee2002cb6f..168ca0cc6b43785be65c8294d33f98098e612291 100644 (file)
@@ -96,6 +96,14 @@ static void dwarf2out_source_line (unsigned int, const char *, int, bool);
 static rtx last_var_location_insn;
 #endif
 
+#ifdef VMS_DEBUGGING_INFO
+/* Define this macro to be a nonzero value if the directory specifications
+    which are output in the debug info should end with a separator.  */
+#define DWARF2_DIR_SHOULD_END_WITH_SEPARATOR 1
+#else
+#define DWARF2_DIR_SHOULD_END_WITH_SEPARATOR 0
+#endif
+
 #ifndef DWARF2_FRAME_INFO
 # ifdef DWARF2_DEBUGGING_INFO
 #  define DWARF2_FRAME_INFO \
@@ -9601,7 +9609,9 @@ output_file_names (void)
   idx = 1;
   idx_offset = dirs[0].length > 0 ? 1 : 0;
   for (i = 1 - idx_offset; i < ndirs; i++)
-    dw2_asm_output_nstring (dirs[i].path, dirs[i].length - 1,
+    dw2_asm_output_nstring (dirs[i].path,
+                           dirs[i].length
+                            - !DWARF2_DIR_SHOULD_END_WITH_SEPARATOR,
                            "Directory Entry: 0x%x", i + idx_offset);
 
   dw2_asm_output_data (1, 0, "End directory table");
@@ -12883,7 +12893,23 @@ static void
 add_comp_dir_attribute (dw_die_ref die)
 {
   const char *wd = get_src_pwd ();
-  if (wd != NULL)
+  char *wd1;
+
+  if (wd == NULL)
+    return;
+
+  if (DWARF2_DIR_SHOULD_END_WITH_SEPARATOR)
+    {
+      int wdlen;
+
+      wdlen = strlen (wd);
+      wd1 = GGC_NEWVEC (char, wdlen + 2);
+      strcpy (wd1, wd);
+      wd1 [wdlen] = DIR_SEPARATOR;
+      wd1 [wdlen + 1] = 0;
+      wd = wd1;
+    }
+
     add_AT_string (die, DW_AT_comp_dir, remap_debug_filename (wd));
 }
 
This page took 1.69857 seconds and 5 git commands to generate.