[exceptions] introduce suspend-on-native-crash that suspends on every native crash
authorBernhard Urban <bernhard.urban@xamarin.com>
Fri, 10 Feb 2017 07:38:07 +0000 (08:38 +0100)
committerBernhard Urban <bernhard.urban@xamarin.com>
Fri, 10 Feb 2017 18:55:30 +0000 (19:55 +0100)
not just `SIGSEGV`. rename `suspend-on-sigsegv` but keep it as an alias around.

man/mono.1
mono/mini/mini-exceptions.c
mono/mini/mini-runtime.c
mono/mini/mini.h

index ef13ea04f687662685e404f3aeaca950df961480..946f7afd8b025eeae5b3f95a0492c683a7847ce0 100644 (file)
@@ -1732,11 +1732,14 @@ values.
 This option allows using single-steps and breakpoints in hardware
 where we cannot do it with signals.
 .TP
-\fBsuspend-on-sigsegv\fR
-This option will suspend the program when a native SIGSEGV is received.
+\fBsuspend-on-native-crash\fR
+This option will suspend the program when a native crash occurs (SIGSEGV, SIGILL, ...).
 This is useful for debugging crashes which do not happen under gdb,
 since a live process contains more information than a core file.
 .TP
+\fBsuspend-on-sigsegv\fR
+Same as \fBsuspend-on-native-crash\fR.
+.TP
 \fBsuspend-on-exception\fR
 This option will suspend the program when an exception occurs.
 .TP
index c390ee9ea6cae9ccd31f5ebf2f3a2e1e5075838b..1813122d609def11d098566043de73514a44e3ae 100644 (file)
@@ -2482,7 +2482,7 @@ mono_handle_native_crash (const char *signal, void *ctx, MONO_SIG_HANDLER_INFO_T
        if (handling_sigsegv && is_sigsegv)
                return;
 
-       if (mini_get_debug_options ()->suspend_on_sigsegv && is_sigsegv) {
+       if (mini_get_debug_options ()->suspend_on_native_crash) {
                mono_runtime_printf_err ("Received %s, suspending...", signal);
 #ifdef HOST_WIN32
                while (1)
index d9a9dbb804149b71b60c3dc1882c34e7d08d1965..9eade804217ea75654fc94e2b1a1e5eb3ecfa823 100644 (file)
@@ -3138,8 +3138,8 @@ mini_parse_debug_option (const char *option)
                debug_options.break_on_unverified = TRUE;
        else if (!strcmp (option, "no-gdb-backtrace"))
                debug_options.no_gdb_backtrace = TRUE;
-       else if (!strcmp (option, "suspend-on-sigsegv"))
-               debug_options.suspend_on_sigsegv = TRUE;
+       else if (!strcmp (option, "suspend-on-native-crash") || !strcmp (option, "suspend-on-sigsegv"))
+               debug_options.suspend_on_native_crash = TRUE;
        else if (!strcmp (option, "suspend-on-exception"))
                debug_options.suspend_on_exception = TRUE;
        else if (!strcmp (option, "suspend-on-unhandled"))
@@ -3204,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', 'no-compact-seq-points', 'single-imm-size', 'init-stacks', 'casts', 'soft-breakpoints', 'check-pinvoke-callconv', '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-native-crash', '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', 'use-fallback-tls', 'debug-domain-unload', 'partial-sharing', 'align-small-structs', 'native-debugger-break'\n");
                        exit (1);
                }
        }
index 47779970b616f83a01375bddababc7b018bdec97..60911597d97062a1ff48288d0b233a9fec6066a0 100644 (file)
@@ -2132,7 +2132,7 @@ typedef struct {
        gboolean better_cast_details;
        gboolean mdb_optimizations;
        gboolean no_gdb_backtrace;
-       gboolean suspend_on_sigsegv;
+       gboolean suspend_on_native_crash;
        gboolean suspend_on_exception;
        gboolean suspend_on_unhandled;
        gboolean dyn_runtime_invoke;