diff --git a/Source/Engine/Engine/CommandLine.cpp b/Source/Engine/Engine/CommandLine.cpp index edfc9c268..d6c03b070 100644 --- a/Source/Engine/Engine/CommandLine.cpp +++ b/Source/Engine/Engine/CommandLine.cpp @@ -109,7 +109,10 @@ bool CommandLine::Parse(const Char* cmdLine) PARSE_BOOL_SWITCH("-novsync ", NoVSync); PARSE_BOOL_SWITCH("-nolog ", NoLog); PARSE_BOOL_SWITCH("-std ", Std); +#if !BUILD_RELEASE PARSE_ARG_SWITCH("-debug ", DebuggerAddress); + PARSE_BOOL_SWITCH("-debugwait ", WaitForDebugger); +#endif #if PLATFORM_HAS_HEADLESS_MODE PARSE_BOOL_SWITCH("-headless ", Headless); #endif diff --git a/Source/Engine/Engine/CommandLine.h b/Source/Engine/Engine/CommandLine.h index 278620bf5..62b38ca99 100644 --- a/Source/Engine/Engine/CommandLine.h +++ b/Source/Engine/Engine/CommandLine.h @@ -49,11 +49,20 @@ public: /// Nullable Std; +#if !BUILD_RELEASE + /// /// -debug !ip:port! (Mono debugger address) /// Nullable DebuggerAddress; + /// + /// -debugwait (instructs Mono debugger to wait for client attach for 5 seconds) + /// + Nullable WaitForDebugger; + +#endif + #if PLATFORM_HAS_HEADLESS_MODE /// diff --git a/Source/Engine/Scripting/ManagedCLR/MCore.Mono.cpp b/Source/Engine/Scripting/ManagedCLR/MCore.Mono.cpp index 95d66706f..a1420fd24 100644 --- a/Source/Engine/Scripting/ManagedCLR/MCore.Mono.cpp +++ b/Source/Engine/Scripting/ManagedCLR/MCore.Mono.cpp @@ -423,7 +423,7 @@ bool MCore::LoadEngine() } char buffer[150]; - sprintf(buffer, "--debugger-agent=transport=dt_socket,address=%s:%d,embedding=1,server=y,suspend=n,loglevel=%d", debuggerIp.Get(), debuggerPort, debuggerLogLevel); + sprintf(buffer, "--debugger-agent=transport=dt_socket,address=%s:%d,embedding=1,server=y,suspend=%s,loglevel=%d", debuggerIp.Get(), debuggerPort, CommandLine::Options.WaitForDebugger ? "y,timeout=5000" : "n", debuggerLogLevel); const char* options[] = { "--soft-breakpoints",