From: Bernhard Urban Date: Fri, 10 Feb 2017 07:38:07 +0000 (+0100) Subject: [exceptions] introduce suspend-on-native-crash that suspends on every native crash X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=6c856a2dce3c6c2bfcb901115ceb06a9fa4e2fc8 [exceptions] introduce suspend-on-native-crash that suspends on every native crash not just `SIGSEGV`. rename `suspend-on-sigsegv` but keep it as an alias around. --- diff --git a/man/mono.1 b/man/mono.1 index ef13ea04f68..946f7afd8b0 100644 --- a/man/mono.1 +++ b/man/mono.1 @@ -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 diff --git a/mono/mini/mini-exceptions.c b/mono/mini/mini-exceptions.c index c390ee9ea6c..1813122d609 100644 --- a/mono/mini/mini-exceptions.c +++ b/mono/mini/mini-exceptions.c @@ -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) diff --git a/mono/mini/mini-runtime.c b/mono/mini/mini-runtime.c index d9a9dbb8041..9eade804217 100644 --- a/mono/mini/mini-runtime.c +++ b/mono/mini/mini-runtime.c @@ -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); } } diff --git a/mono/mini/mini.h b/mono/mini/mini.h index 47779970b61..60911597d97 100644 --- a/mono/mini/mini.h +++ b/mono/mini/mini.h @@ -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;