diff options
author | Thays Grazia <thaystg@gmail.com> | 2022-07-14 22:05:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-14 22:05:39 +0300 |
commit | 89ae626b3d654f2e1bec7ee53ff90282fe134a2a (patch) | |
tree | 943f83749bc73418c092d9c241265e78a945b1c7 | |
parent | 6bb998531a15c81a5f5a93c219c17b9472ab7358 (diff) |
[debugger] Fix debugging on Mac and iOS (#21516)
Backport https://github.com/dotnet/runtime/pull/71436
-rw-r--r-- | mono/mini/debugger-agent.c | 38 | ||||
-rw-r--r-- | mono/mini/mini-runtime.c | 12 |
2 files changed, 25 insertions, 25 deletions
diff --git a/mono/mini/debugger-agent.c b/mono/mini/debugger-agent.c index ae697d64fa0..af329006e66 100644 --- a/mono/mini/debugger-agent.c +++ b/mono/mini/debugger-agent.c @@ -875,6 +875,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 @@ -1002,25 +1021,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/mono/mini/mini-runtime.c b/mono/mini/mini-runtime.c index b8df86ea538..8ad9189251f 100644 --- a/mono/mini/mini-runtime.c +++ b/mono/mini/mini-runtime.c @@ -4383,12 +4383,6 @@ mini_init (const char *filename, const char *runtime_version) } #endif - mono_interp_stub_init (); -#ifndef DISABLE_INTERPRETER - if (mono_use_interpreter) - mono_ee_interp_init (mono_interp_opts_string); -#endif - mono_debugger_agent_stub_init (); #ifndef DISABLE_SDB mono_debugger_agent_init (); @@ -4397,6 +4391,12 @@ mini_init (const char *filename, const char *runtime_version) if (sdb_options) mini_get_dbg_callbacks ()->parse_options (sdb_options); + mono_interp_stub_init (); +#ifndef DISABLE_INTERPRETER + if (mono_use_interpreter) + mono_ee_interp_init (mono_interp_opts_string); +#endif + mono_os_mutex_init_recursive (&jit_mutex); mono_cross_helpers_run (); |