+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
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 \
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");
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));
}