From 7bf5f48b7973c571c0a7d6da4480efe76fe14281 Mon Sep 17 00:00:00 2001 From: rupp Date: Tue, 28 Jul 2009 18:07:32 +0000 Subject: [PATCH] * dwarf2out.c (output_file_names): Test new macro DWARF2_DIR_SHOULD_END_WITH_SEPARATOR. (add_comp_dir_attribute): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150173 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/dwarf2out.c | 30 ++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cd29b14..f337538 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-07-28 Douglas B Rupp + + * dwarf2out.c (output_file_names): Test new macro + DWARF2_DIR_SHOULD_END_WITH_SEPARATOR. + (add_comp_dir_attribute): Likewise. + 2009-07-28 Kai Tietz * config/i386/mingw-w64.h (LINK_SPEC): Add diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index d3ed637..168ca0c 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -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)); } -- 2.7.4