Add -WaitForDebugger command line flag - #183
Merged
Merged
Conversation
Adds a cross-platform F_DEBUG_BREAK() macro (MSVC __debugbreak, Clang __builtin_debugtrap, GCC raise(SIGTRAP)) and wires -WaitForDebugger=true into Engine::Startup right after FlingConfig::Get().Init(), so a debugger can catch the process early in startup on any platform. Verified under gdb: hits the trap exactly at that line when the flag is set, and is a no-op when it's not. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-WaitForDebugger=truecommand line flag (à la Unreal's-waitfordebugger).F_DEBUG_BREAK()macro inEngine.h(MSVC__debugbreak(), Clang__builtin_debugtrap(), GCCraise(SIGTRAP)), so callers don't need their own compiler#ifdefladder.Engine::Startup, right afterFlingConfig::Get().Init(), using theCommandLine/GetValueAs<bool>API from Add command line argument parser with ini ConsoleVariables fallback #179.Test plan
gdb:Sandbox -WaitForDebugger=truehitsSIGTRAPexactly at the intended line inEngine::Startup; running without the flag proceeds straight through with no trap.FlingTestssuite intentionally — triggering the trap with no debugger attached would abort the test process in CI.🤖 Generated with Claude Code