dwarf2out.c (output_file_names): Test new macro DWARF2_DIR_SHOULD_END_WITH_SEPARATOR.

* dwarf2out.c (output_file_names): Test new macro
	DWARF2_DIR_SHOULD_END_WITH_SEPARATOR.
	(add_comp_dir_attribute): Likewise.

From-SVN: r150173
This commit is contained in:
Douglas B Rupp 2009-07-28 18:07:32 +00:00 committed by Douglas Rupp
parent 032502c26f
commit dde08f9bc7
2 changed files with 34 additions and 2 deletions

View 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

View 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));
}