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