[aot] Reworked sequence points file AOT option to allow an explicit path passed.
authorJoão Matos <joao@tritao.eu>
Wed, 17 Feb 2016 15:49:19 +0000 (15:49 +0000)
committerJoão Matos <joao@tritao.eu>
Wed, 17 Feb 2016 15:59:26 +0000 (15:59 +0000)
This will be used to fix msym files being overwritten per ABI compilation in AOT compilation driven by Monodroid.

mono/mini/aot-compiler.c
mono/mini/seq-points.c
mono/mini/seq-points.h

index 772105fd258340dea73132f38e21cf16505c2092..48354b70578e4718dfc13425014d86b3caaa45f4 100644 (file)
@@ -111,6 +111,7 @@ typedef struct MonoAotOptions {
        gboolean log_generics;
        gboolean log_instances;
        gboolean gen_seq_points_file;
+       char *gen_seq_points_file_path;
        gboolean direct_pinvoke;
        gboolean direct_icalls;
        gboolean no_direct_calls;
@@ -6760,7 +6761,12 @@ mono_aot_parse_options (const char *aot_options, MonoAotOptions *opts)
                        opts->ld_flags = g_strdup (arg + strlen ("ld-flags="));                 
                } else if (str_begins_with (arg, "soft-debug")) {
                        opts->soft_debug = TRUE;
+               } else if (str_begins_with (arg, "gen-seq-points-file=")) {
+                       debug_options.gen_seq_points_compact_data = TRUE;
+                       opts->gen_seq_points_file = TRUE;
+                       opts->gen_seq_points_file_path = g_strdup (arg + strlen ("gen-seq-points-file="));;
                } else if (str_begins_with (arg, "gen-seq-points-file")) {
+                       debug_options.gen_seq_points_compact_data = TRUE;
                        opts->gen_seq_points_file = TRUE;
                } else if (str_begins_with (arg, "direct-pinvoke")) {
                        opts->direct_pinvoke = TRUE;
@@ -8600,8 +8606,9 @@ emit_exception_info (MonoAotCompile *acfg)
        }
 
        if (seq_points_to_file) {
-               char *seq_points_aot_file;
-               mono_image_get_aot_seq_point_path (acfg->image, &seq_points_aot_file);
+               char *seq_points_aot_file = acfg->aot_opts.gen_seq_points_file_path ? acfg->aot_opts.gen_seq_points_file_path
+                       : g_strdup_printf("%s%s", acfg->image->name, SEQ_POINT_AOT_EXT);
+               printf("%s\n", seq_points_aot_file);
                mono_seq_point_data_write (&sp_data, seq_points_aot_file);
                mono_seq_point_data_free (&sp_data);
                g_free (seq_points_aot_file);
index ac22ca41f070d0201b7c4b55371cc597b1e97a51..434a11f43702db5e180d652eac020f06740566db 100644 (file)
@@ -294,11 +294,3 @@ mono_bb_deduplicate_op_il_seq_points (MonoCompile *cfg, MonoBasicBlock *bb)
                MONO_REMOVE_INS (bb, prev);
        };
 }
-
-void
-mono_image_get_aot_seq_point_path (MonoImage *image, char **str)
-{
-       int size = strlen (image->name) + strlen (SEQ_POINT_AOT_EXT) + 1;
-       *str = (char *)g_malloc (size);
-       g_sprintf (*str, "%s%s", image->name, SEQ_POINT_AOT_EXT);
-}
index 3d053dba3dd57f944c66919c942c582bdf575163..d0e6f5aa1575f5fd87bde866a4d8fc31a51eea50 100644 (file)
@@ -25,7 +25,4 @@ mono_find_seq_point (MonoDomain *domain, MonoMethod *method, gint32 il_offset, M
 void
 mono_bb_deduplicate_op_il_seq_points (MonoCompile *cfg, MonoBasicBlock *bb);
 
-void
-mono_image_get_aot_seq_point_path (MonoImage *image, char **str);
-
 #endif /* __MONO_SEQ_POINTS_H__ */