Skip to content

Commit 2a19f87

Browse files
Backport dotnet/runtime#71436 Backport of #21516 to 2020-02 Co-authored-by: Thays Grazia <[email protected]>
1 parent 6051b71 commit 2a19f87

File tree

2 files changed

+25
-25
lines changed

2 files changed

+25
-25
lines changed

mono/mini/debugger-agent.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -908,6 +908,25 @@ debugger_agent_parse_options (char *options)
908908
exit (1);
909909
}
910910
}
911+
912+
mini_get_debug_options ()->gen_sdb_seq_points = TRUE;
913+
/*
914+
* This is needed because currently we don't handle liveness info.
915+
*/
916+
mini_get_debug_options ()->mdb_optimizations = TRUE;
917+
918+
#ifndef MONO_ARCH_HAVE_CONTEXT_SET_INT_REG
919+
/* This is needed because we can't set local variables in registers yet */
920+
mono_disable_optimizations (MONO_OPT_LINEARS);
921+
#endif
922+
923+
/*
924+
* The stack walk done from thread_interrupt () needs to be signal safe, but it
925+
* isn't, since it can call into mono_aot_find_jit_info () which is not signal
926+
* safe (#3411). So load AOT info eagerly when the debugger is running as a
927+
* workaround.
928+
*/
929+
mini_get_debug_options ()->load_aot_jit_info_eagerly = TRUE;
911930
}
912931

913932
void
@@ -1035,25 +1054,6 @@ debugger_agent_init (void)
10351054
objrefs_init ();
10361055
suspend_init ();
10371056

1038-
mini_get_debug_options ()->gen_sdb_seq_points = TRUE;
1039-
/*
1040-
* This is needed because currently we don't handle liveness info.
1041-
*/
1042-
mini_get_debug_options ()->mdb_optimizations = TRUE;
1043-
1044-
#ifndef MONO_ARCH_HAVE_CONTEXT_SET_INT_REG
1045-
/* This is needed because we can't set local variables in registers yet */
1046-
mono_disable_optimizations (MONO_OPT_LINEARS);
1047-
#endif
1048-
1049-
/*
1050-
* The stack walk done from thread_interrupt () needs to be signal safe, but it
1051-
* isn't, since it can call into mono_aot_find_jit_info () which is not signal
1052-
* safe (#3411). So load AOT info eagerly when the debugger is running as a
1053-
* workaround.
1054-
*/
1055-
mini_get_debug_options ()->load_aot_jit_info_eagerly = TRUE;
1056-
10571057
#ifdef HAVE_SETPGID
10581058
if (agent_config.setpgid)
10591059
setpgid (0, 0);

mono/mini/mini-runtime.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4159,12 +4159,6 @@ mini_init (const char *filename, const char *runtime_version)
41594159
}
41604160
#endif
41614161

4162-
mono_interp_stub_init ();
4163-
#ifndef DISABLE_INTERPRETER
4164-
if (mono_use_interpreter)
4165-
mono_ee_interp_init (mono_interp_opts_string);
4166-
#endif
4167-
41684162
mono_debugger_agent_stub_init ();
41694163
#ifndef DISABLE_SDB
41704164
mono_debugger_agent_init ();
@@ -4173,6 +4167,12 @@ mini_init (const char *filename, const char *runtime_version)
41734167
if (sdb_options)
41744168
mini_get_dbg_callbacks ()->parse_options (sdb_options);
41754169

4170+
mono_interp_stub_init ();
4171+
#ifndef DISABLE_INTERPRETER
4172+
if (mono_use_interpreter)
4173+
mono_ee_interp_init (mono_interp_opts_string);
4174+
#endif
4175+
41764176
mono_os_mutex_init_recursive (&jit_mutex);
41774177

41784178
mono_cross_helpers_run ();

0 commit comments

Comments
 (0)