You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-22 15:06:45 +00:00
Mono/C#: Allow debugging exported games
- Include PDB files in exported games. - Release export templates also allow debugging now. Right now the only way to enable debugging in exported games is with the environment variables, which may be cumbersome or not even possible on some platforms.
This commit is contained in:
@@ -129,12 +129,8 @@ void gd_mono_profiler_init() {
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(DEBUG_ENABLED)
|
||||
|
||||
void gd_mono_debug_init() {
|
||||
|
||||
mono_debug_init(MONO_DEBUG_FORMAT_MONO);
|
||||
|
||||
CharString da_args = OS::get_singleton()->get_environment("GODOT_MONO_DEBUGGER_AGENT").utf8();
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
@@ -159,6 +155,10 @@ void gd_mono_debug_init() {
|
||||
return; // Exported games don't use the project settings to setup the debugger agent
|
||||
#endif
|
||||
|
||||
// Debugging enabled
|
||||
|
||||
mono_debug_init(MONO_DEBUG_FORMAT_MONO);
|
||||
|
||||
// --debugger-agent=help
|
||||
const char *options[] = {
|
||||
"--soft-breakpoints",
|
||||
@@ -167,7 +167,6 @@ void gd_mono_debug_init() {
|
||||
mono_jit_parse_options(2, (char **)options);
|
||||
}
|
||||
|
||||
#endif // defined(DEBUG_ENABLED)
|
||||
#endif // !defined(JAVASCRIPT_ENABLED)
|
||||
|
||||
#if defined(JAVASCRIPT_ENABLED)
|
||||
@@ -175,6 +174,7 @@ MonoDomain *gd_initialize_mono_runtime() {
|
||||
const char *vfs_prefix = "managed";
|
||||
int enable_debugging = 0;
|
||||
|
||||
// TODO: Provide a way to enable debugging on WASM release builds.
|
||||
#ifdef DEBUG_ENABLED
|
||||
enable_debugging = 1;
|
||||
#endif
|
||||
@@ -185,9 +185,7 @@ MonoDomain *gd_initialize_mono_runtime() {
|
||||
}
|
||||
#else
|
||||
MonoDomain *gd_initialize_mono_runtime() {
|
||||
#ifdef DEBUG_ENABLED
|
||||
gd_mono_debug_init();
|
||||
#endif
|
||||
|
||||
#if defined(IPHONE_ENABLED) || defined(ANDROID_ENABLED)
|
||||
// I don't know whether this actually matters or not
|
||||
|
||||
Reference in New Issue
Block a user