diff --git a/src/mono/mono/component/debugger-agent.c b/src/mono/mono/component/debugger-agent.c index 64ce87be75ff9a..609b2121996855 100644 --- a/src/mono/mono/component/debugger-agent.c +++ b/src/mono/mono/component/debugger-agent.c @@ -689,6 +689,25 @@ debugger_agent_parse_options (char *options) exit (1); } } + + mini_get_debug_options ()->gen_sdb_seq_points = TRUE; + /* + * This is needed because currently we don't handle liveness info. + */ + mini_get_debug_options ()->mdb_optimizations = TRUE; + +#ifndef MONO_ARCH_HAVE_CONTEXT_SET_INT_REG + /* This is needed because we can't set local variables in registers yet */ + mono_disable_optimizations (MONO_OPT_LINEARS); +#endif + + /* + * The stack walk done from thread_interrupt () needs to be signal safe, but it + * isn't, since it can call into mono_aot_find_jit_info () which is not signal + * safe (#3411). So load AOT info eagerly when the debugger is running as a + * workaround. + */ + mini_get_debug_options ()->load_aot_jit_info_eagerly = TRUE; } void @@ -808,25 +827,6 @@ debugger_agent_init (void) objrefs_init (); suspend_init (); - mini_get_debug_options ()->gen_sdb_seq_points = TRUE; - /* - * This is needed because currently we don't handle liveness info. - */ - mini_get_debug_options ()->mdb_optimizations = TRUE; - -#ifndef MONO_ARCH_HAVE_CONTEXT_SET_INT_REG - /* This is needed because we can't set local variables in registers yet */ - mono_disable_optimizations (MONO_OPT_LINEARS); -#endif - - /* - * The stack walk done from thread_interrupt () needs to be signal safe, but it - * isn't, since it can call into mono_aot_find_jit_info () which is not signal - * safe (#3411). So load AOT info eagerly when the debugger is running as a - * workaround. - */ - mini_get_debug_options ()->load_aot_jit_info_eagerly = TRUE; - #ifdef HAVE_SETPGID if (agent_config.setpgid) setpgid (0, 0); diff --git a/src/mono/mono/mini/mini-runtime.c b/src/mono/mono/mini/mini-runtime.c index e87480ee3c43f2..790f6d46247cf4 100644 --- a/src/mono/mono/mini/mini-runtime.c +++ b/src/mono/mono/mini/mini-runtime.c @@ -4479,13 +4479,15 @@ mini_init (const char *filename) #endif mono_interp_stub_init (); + + mono_components_init (); + + mono_component_debugger ()->parse_options (mono_debugger_agent_get_sdb_options ()); + #ifndef DISABLE_INTERPRETER if (mono_use_interpreter) mono_ee_interp_init (mono_interp_opts_string); #endif - mono_components_init (); - - mono_component_debugger ()->parse_options (mono_debugger_agent_get_sdb_options ()); mono_os_mutex_init_recursive (&jit_mutex);