Escape the .file path name generated in the asembly code. clang does not mind, but...
authorSebastien Pouliot <sebastien@xamarin.com>
Thu, 11 Jul 2013 19:37:43 +0000 (15:37 -0400)
committerZoltan Varga <vargaz@gmail.com>
Mon, 15 Jul 2013 18:24:05 +0000 (20:24 +0200)
mono/mini/aot-compiler.c
mono/mini/dwarfwriter.c
mono/mini/dwarfwriter.h

index 3e72a91b5fd4c87476d824bd9f4e5f604b357e7c..b1c9918d7195f4a635821848152cb157b0c0cb9a 100644 (file)
@@ -4383,7 +4383,7 @@ get_file_index (MonoAotCompile *acfg, const char *source_file)
                findex = g_hash_table_size (acfg->dwarf_ln_filenames) + 1;
                g_hash_table_insert (acfg->dwarf_ln_filenames, g_strdup (source_file), GINT_TO_POINTER (findex));
                emit_unset_mode (acfg);
-               fprintf (acfg->fp, ".file %d \"%s\"\n", findex, source_file);
+               fprintf (acfg->fp, ".file %d \"%s\"\n", findex, mono_dwarf_escape_path (source_file));
        }
        return findex;
 }
index ae72268f8d85d3870460532186f262c540e4e113..d73c6b55cba0e75052686f9c18e605f208cb1dae 100644 (file)
@@ -742,8 +742,8 @@ emit_line_number_info_begin (MonoDwarfWriter *w)
        emit_label (w, ".Ldebug_line_end");
 }
 
-static char *
-escape_path (char *name)
+char *
+mono_dwarf_escape_path (char *name)
 {
        if (strchr (name, '\\')) {
                char *s = g_malloc (strlen (name) * 2);
@@ -852,7 +852,7 @@ emit_all_line_number_info (MonoDwarfWriter *w)
        for (i = 0; i < w->line_number_dir_index; ++i) {
                char *dir = g_hash_table_lookup (index_to_dir, GUINT_TO_POINTER (i + 1));
 
-               emit_string (w, escape_path (dir));
+               emit_string (w, mono_dwarf_escape_path (dir));
        }
        /* End of Includes */
        emit_byte (w, 0);
@@ -873,7 +873,7 @@ emit_all_line_number_info (MonoDwarfWriter *w)
                if (basename)
                        emit_string (w, basename);
                else
-                       emit_string (w, escape_path (name));
+                       emit_string (w, mono_dwarf_escape_path (name));
                emit_uleb128 (w, dir_index);
                emit_byte (w, 0);
                emit_byte (w, 0);
index 37927826dad9305977991164d50382756123a7ae..d766beda0078e27bd9b84da2cbe7121361651ed2 100644 (file)
@@ -35,4 +35,7 @@ void mono_dwarf_writer_emit_trampoline (MonoDwarfWriter *w, const char *tramp_na
 void
 mono_dwarf_writer_emit_method (MonoDwarfWriter *w, MonoCompile *cfg, MonoMethod *method, char *start_symbol, char *end_symbol, guint8 *code, guint32 code_size, MonoInst **args, MonoInst **locals, GSList *unwind_info, MonoDebugMethodJitInfo *debug_info) MONO_INTERNAL;
 
+char *
+mono_dwarf_escape_path (char *name);
+
 #endif