Claude's crazy exception handler hack

This commit is contained in:
Henrik Rydgård committed 2026-07-27 23:41:13 +02:00
1 parent 16a38b090a
commit 34454f9d03
6 files changed
+78 -6

No files matched your search

+6
View File
@@ -186,6 +186,7 @@ static const CommandLineParam g_autoParams[] = {
{POFF(memReadAction), CmdParamType::Enum, "memread", '\0', "Set the action for memory read exceptions", CmdLineMode::Both, g_ExceptionActionValues, ARRAY_SIZE(g_ExceptionActionValues)},
{POFF(memWriteAction), CmdParamType::Enum, "memwrite", '\0', "Set the action for memory write exceptions", CmdLineMode::Both, g_ExceptionActionValues, ARRAY_SIZE(g_ExceptionActionValues)},
{POFF(breakAction), CmdParamType::Enum, "break", '\0', "Set the action for break exceptions", CmdLineMode::Both, g_ExceptionActionValues, ARRAY_SIZE(g_ExceptionActionValues)},
{POFF(logNativeCrashes), CmdParamType::Bool, "log-native-crashes", '\0', "Log a native stack trace (Windows only) on an otherwise-unhandled crash", CmdLineMode::Both},
{POFF(verbose), CmdParamType::Bool, "verbose", '\0', "Enable verbose output", CmdLineMode::Both},
// TODO: At some point we should maybe simply expose all config settings to be set directly from the command line automatically?
@@ -498,6 +499,11 @@ void CommandLineOptions::ApplyToConfig() const {
g_Config.DoNotSaveSetting(&g_Config.iExceptionActionBreak);
}
if (logNativeCrashes.has_value()) {
g_Config.bLogNativeCrashStackTraces = logNativeCrashes.value();
g_Config.DoNotSaveSetting(&g_Config.bLogNativeCrashStackTraces);
}
// --vsh is applied by the caller (by setting their boot file name variable).
// Note: dpi is not applied here - it's platform-specific.