[runtime] Enable compact seq point by default
authorMarcos Henrich <marcos.henrich@xamarin.com>
Tue, 12 Jul 2016 16:31:22 +0000 (17:31 +0100)
committerMarcos Henrich <marcos.henrich@xamarin.com>
Wed, 13 Jul 2016 09:52:27 +0000 (10:52 +0100)
Enable compact seq points by default so that the stack trace have IL
offsets instead os native ones.

This changes will allow any stacktrace generated from now on to be
symbolicated using mono-symbolicate.

Deprecates options gen-compact-seq-points.

man/mono.1
mcs/tools/mono-symbolicate/Makefile
mono/mini/aot-compiler.c
mono/mini/mini-runtime.c
mono/mini/mini.c
mono/mini/mini.h
mono/mini/test_op_il_seq_point.sh

index b70f60bb8b43e74d6095f6723b668cd4adae3c92..81f5ae9838987a1805e1d9bcb175bc758af330e0 100644 (file)
@@ -1652,11 +1652,11 @@ Automatically generates sequence points where the
 IL stack is empty.  These are places where the debugger can set a
 breakpoint.
 .TP
-\fBgen-compact-seq-points\fR
-This option generates sequence points data that maps native offsets to
-IL offsets. Sequence point data is used to display IL offset in
-stacktraces. Stacktraces with IL offsets can be symbolicated using
-mono-symbolicate tool.
+\fBno-compact-seq-points\fR
+Unless the option is used, the runtime generates sequence points data that
+maps native offsets to IL offsets. Sequence point data is used to
+display IL offset in stacktraces. Stacktraces with IL offsets can be
+symbolicated using mono-symbolicate tool.
 .TP
 \fBhandle-sigint\fR
 Captures the interrupt signal (Control-C) and displays a stack trace
index 32059cfdc67eb3f759f732f983733f170eab4bbf..62dd73f7f226821297ce0dcbe22708d28a2f9570 100644 (file)
@@ -24,7 +24,7 @@ SYMBOLICATE_RESULT_FILE = $(OUT_DIR)/symbolicate.result
 SYMBOLICATE_EXPECTED_FILE = Test/symbolicate.expected
 
 CHECK_DIFF = @\
-       MONO_DEBUG=gen-compact-seq-points $(MONO) $(TEST_EXE) > $(STACKTRACE_FILE); \
+       $(MONO) $(TEST_EXE) > $(STACKTRACE_FILE); \
        $(MONO) $(LIB_PATH)/$(PROGRAM) $(MSYM_DIR) $(STACKTRACE_FILE) > $(SYMBOLICATE_RAW_FILE); \
        sed "s/).*Test\//) in /" $(SYMBOLICATE_RAW_FILE) | sed '/\[MVID\]/d' | sed '/\[AOTID\]/d' > $(SYMBOLICATE_RESULT_FILE); \
        DIFF=$$(diff $(SYMBOLICATE_RESULT_FILE) $(SYMBOLICATE_EXPECTED_FILE)); \
@@ -64,7 +64,7 @@ ifeq ($(AOT_SUPPORTED), 1)
        @echo "Checking $(TEST_EXE) with AOT in $(OUT_DIR)"
        $(PREPARE_OUTDIR)
        $(COMPILE)
-       @MONO_DEBUG=gen-compact-seq-points $(MONO) --aot $(TEST_EXE) > /dev/null
+       @$(MONO) --aot $(TEST_EXE) > /dev/null
        $(CHECK_DIFF)
 endif
 
@@ -74,6 +74,6 @@ ifeq ($(AOT_SUPPORTED), 1)
        @echo "Checking $(TEST_EXE) with AOT (using .msym) in $(OUT_DIR)"
        $(PREPARE_OUTDIR)
        $(COMPILE)
-       @MONO_DEBUG=gen-compact-seq-points $(MONO) --aot=msym-dir=$(MSYM_DIR) $(TEST_EXE) > /dev/null
+       @$(MONO) --aot=msym-dir=$(MSYM_DIR) $(TEST_EXE) > /dev/null
        $(CHECK_DIFF)
 endif
index 637e4b61318679686806b910a560a0b666be5538..9b4c7b6d2a478bf717b039ed763ce5a3bc3c56de 100644 (file)
@@ -7051,7 +7051,7 @@ mono_aot_parse_options (const char *aot_options, MonoAotOptions *opts)
                } else if (str_begins_with (arg, "soft-debug")) {
                        opts->soft_debug = TRUE;
                } else if (str_begins_with (arg, "msym-dir=")) {
-                       debug_options.gen_seq_points_compact_data = TRUE;
+                       debug_options.no_seq_points_compact_data = FALSE;
                        opts->gen_msym_dir = TRUE;
                        opts->gen_msym_dir_path = g_strdup (arg + strlen ("msym_dir="));;
                } else if (str_begins_with (arg, "direct-pinvoke")) {
index 83420c5224454b776c59d42a65d582694ffa7fcb..861ab5cf437789a04e5926d4b14a3b4680fef364 100644 (file)
@@ -3157,7 +3157,9 @@ mini_parse_debug_option (const char *option)
        else if (!strcmp (option, "gen-seq-points"))
                debug_options.gen_sdb_seq_points = TRUE;
        else if (!strcmp (option, "gen-compact-seq-points"))
-               debug_options.gen_seq_points_compact_data = TRUE;
+               fprintf (stderr, "Mono Warning: option gen-compact-seq-points is deprecated.\n");
+       else if (!strcmp (option, "no-compact-seq-points"))
+               debug_options.no_seq_points_compact_data = TRUE;
        else if (!strcmp (option, "single-imm-size"))
                debug_options.single_imm_size = TRUE;
        else if (!strcmp (option, "init-stacks"))
@@ -3202,7 +3204,7 @@ mini_parse_debug_options (void)
 
                if (!mini_parse_debug_option (arg)) {
                        fprintf (stderr, "Invalid option for the MONO_DEBUG env variable: %s\n", arg);
-                       fprintf (stderr, "Available options: 'handle-sigint', 'keep-delegates', 'reverse-pinvoke-exceptions', 'collect-pagefault-stats', 'break-on-unverified', 'no-gdb-backtrace', 'suspend-on-sigsegv', 'suspend-on-exception', 'suspend-on-unhandled', 'dont-free-domains', 'dyn-runtime-invoke', 'gdb', 'explicit-null-checks', 'gen-seq-points', 'gen-compact-seq-points', 'single-imm-size', 'init-stacks', 'casts', 'soft-breakpoints', 'check-pinvoke-callconv', 'arm-use-fallback-tls', 'debug-domain-unload', 'partial-sharing', 'align-small-structs', 'native-debugger-break'\n");
+                       fprintf (stderr, "Available options: 'handle-sigint', 'keep-delegates', 'reverse-pinvoke-exceptions', 'collect-pagefault-stats', 'break-on-unverified', 'no-gdb-backtrace', 'suspend-on-sigsegv', 'suspend-on-exception', 'suspend-on-unhandled', 'dont-free-domains', 'dyn-runtime-invoke', 'gdb', 'explicit-null-checks', 'gen-seq-points', 'no-compact-seq-points', 'single-imm-size', 'init-stacks', 'casts', 'soft-breakpoints', 'check-pinvoke-callconv', 'arm-use-fallback-tls', 'debug-domain-unload', 'partial-sharing', 'align-small-structs', 'native-debugger-break'\n");
                        exit (1);
                }
        }
index e497ce406aca70a1a3f81567e4683824053e767e..4c79621baf6b4de15d935abb7486c6c961fd112f 100644 (file)
@@ -3241,7 +3241,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        cfg->disable_omit_fp = debug_options.disable_omit_fp;
        cfg->skip_visibility = method->skip_visibility;
        cfg->orig_method = method;
-       cfg->gen_seq_points = debug_options.gen_seq_points_compact_data || debug_options.gen_sdb_seq_points;
+       cfg->gen_seq_points = !debug_options.no_seq_points_compact_data || debug_options.gen_sdb_seq_points;
        cfg->gen_sdb_seq_points = debug_options.gen_sdb_seq_points;
        cfg->llvm_only = (flags & JIT_FLAG_LLVM_ONLY) != 0;
        cfg->backend = current_backend;
index 531078a3c496b0a231912b89075609221150ce8f..9039f491dabbbe5bc6c4c2c32cb99154be23d3a7 100644 (file)
@@ -2121,7 +2121,7 @@ typedef struct {
         * Next sequence points and flags are required by the debugger agent.
         */
        gboolean gen_sdb_seq_points;
-       gboolean gen_seq_points_compact_data;
+       gboolean no_seq_points_compact_data;
        /*
         * Setting single_imm_size should guarantee that each time managed code is compiled
         * the same instructions and registers are used, regardless of the size of used values.
index 45d32b99c05e54b64969afac9b9c51d6047a07b8..b89cc887ff15f21a57f676bad55f3ca7e51c5d79 100755 (executable)
@@ -49,16 +49,16 @@ get_method () {
 diff_methods () {
        TMP_FILE1=$(tmp_file)
        TMP_FILE2=$(tmp_file)
-       echo "$(MONO_DEBUG=single-imm-size get_methods $1 $2 $3 $4)" >$TMP_FILE1
-       echo "$(MONO_DEBUG=gen-compact-seq-points,single-imm-size get_methods $1 $2 $3 $4)" >$TMP_FILE2
+       echo "$(MONO_DEBUG=no-compact-seq-points,single-imm-size get_methods $1 $2 $3 $4)" >$TMP_FILE1
+       echo "$(MONO_DEBUG=single-imm-size get_methods $1 $2 $3 $4)" >$TMP_FILE2
        diff $TMP_FILE1 $TMP_FILE2
 }
 
 diff_method () {
        TMP_FILE1=$(tmp_file)
        TMP_FILE2=$(tmp_file)
-       echo "$(MONO_DEBUG=single-imm-size get_method $1 $2 $3 $4 $5)" >$TMP_FILE1
-       echo "$(MONO_DEBUG=gen-compact-seq-points,single-imm-size get_method $1 $2 $3 $4 $5 | grep -Ev il_seq_point)" >$TMP_FILE2
+       echo "$(MONO_DEBUG=no-compact-seq-points,single-imm-size get_method $1 $2 $3 $4 $5)" >$TMP_FILE1
+       echo "$(MONO_DEBUG=single-imm-size get_method $1 $2 $3 $4 $5 | grep -Ev il_seq_point)" >$TMP_FILE2
        sdiff -w 150 $TMP_FILE1 $TMP_FILE2
 }