bPromptForRemoteDebugOnEnsure
bPromptForRemoteDebugOnEnsure
#Overview
name: bPromptForRemoteDebugOnEnsure
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 6
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of bPromptForRemoteDebugOnEnsure is to control whether the user should be prompted to allow for a remote debugger to be attached when an ensure() macro is triggered in Unreal Engine.
This setting variable is primarily used by the Core module of Unreal Engine, specifically in the error handling and debugging subsystems. It’s referenced in the GenericPlatformMisc and WindowsPlatformMisc classes, which are part of the platform abstraction layer.
The value of this variable is set during the engine initialization process in the AppInit() function of the FEngineLoop class. It’s read from the engine configuration file (GEngineIni) under the “Engine.ErrorHandling” section with the key “bPromptForRemoteDebugOnEnsure”. It can also be overridden by command-line parameters.
This variable interacts closely with bShouldPromptForRemoteDebugging, another setting that controls remote debugging prompts for all types of errors, not just ensures.
Developers must be aware that this variable is only active in non-shipping builds (#if !UE_BUILD_SHIPPING). In shipping builds, this functionality is completely removed to avoid any performance impact or unwanted behavior in released games.
Best practices when using this variable include:
- Use it during development and testing phases to catch and debug ensure() failures more easily.
- Be cautious about enabling it in builds that might be distributed to end-users or testers, as it could potentially interrupt gameplay.
- Consider disabling it for less critical ensures to avoid excessive prompts during development.
- Use in conjunction with other debugging tools and practices for a comprehensive debugging strategy.
- Remember to configure it appropriately in the engine configuration files for consistent behavior across the development team.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseEngine.ini:2852, section: [Engine.ErrorHandling]
- INI Section:
Engine.ErrorHandling
- Raw value:
false
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/GenericPlatform/GenericPlatformMisc.cpp:518
Scope: file
Source code excerpt:
#if !UE_BUILD_SHIPPING
bool FGenericPlatformMisc::bShouldPromptForRemoteDebugging = false;
bool FGenericPlatformMisc::bPromptForRemoteDebugOnEnsure = false;
#endif //#if !UE_BUILD_SHIPPING
EDeviceScreenOrientation FGenericPlatformMisc::AllowedDeviceOrientation = EDeviceScreenOrientation::Unknown;
ENetworkConnectionStatus FGenericPlatformMisc::CurrentNetworkConnectionStatus = ENetworkConnectionStatus::Connected;
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Windows/WindowsPlatformMisc.cpp:2807
Scope (from outer to inner):
file
function void FWindowsPlatformMisc::PromptForRemoteDebugging
Source code excerpt:
if (bShouldPromptForRemoteDebugging)
{
if (bIsEnsure && !bPromptForRemoteDebugOnEnsure)
{
// Don't prompt on ensures unless overridden
return;
}
if (FApp::IsUnattended())
#Loc: <Workspace>/Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMisc.h:1372
Scope (from outer to inner):
file
function static void SetShouldPromptForRemoteDebugOnEnsure
Source code excerpt:
static void SetShouldPromptForRemoteDebugOnEnsure(bool bInShouldPrompt)
{
bPromptForRemoteDebugOnEnsure = bInShouldPrompt;
}
#endif //#if !UE_BUILD_SHIPPING
/**
* Allows disabling ensure()s without rebuilding the binary, by either a commandline switch or a hotfix.
*
#Loc: <Workspace>/Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformMisc.h:1963
Scope: file
Source code excerpt:
static CORE_API bool bShouldPromptForRemoteDebugging;
/** Whether the user should be prompted to allow for a remote debugger to be attached on an ensure */
static CORE_API bool bPromptForRemoteDebugOnEnsure;
#endif //#if !UE_BUILD_SHIPPING
static CORE_API EDeviceScreenOrientation AllowedDeviceOrientation;
static CORE_API ENetworkConnectionStatus CurrentNetworkConnectionStatus;
#Loc: <Workspace>/Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp:6745
Scope (from outer to inner):
file
function bool FEngineLoop::AppInit
Source code excerpt:
bool bPromptForRemoteDebug = false;
GConfig->GetBool(TEXT("Engine.ErrorHandling"), TEXT("bPromptForRemoteDebugging"), bPromptForRemoteDebug, GEngineIni);
bool bPromptForRemoteDebugOnEnsure = false;
GConfig->GetBool(TEXT("Engine.ErrorHandling"), TEXT("bPromptForRemoteDebugOnEnsure"), bPromptForRemoteDebugOnEnsure, GEngineIni);
if (FParse::Param(FCommandLine::Get(), TEXT("PROMPTREMOTEDEBUG")))
{
bPromptForRemoteDebug = true;
}
#Loc: <Workspace>/Engine/Source/Runtime/Launch/Private/LaunchEngineLoop.cpp:6756
Scope (from outer to inner):
file
function bool FEngineLoop::AppInit
Source code excerpt:
{
bPromptForRemoteDebug = true;
bPromptForRemoteDebugOnEnsure = true;
}
FPlatformMisc::SetShouldPromptForRemoteDebugging(bPromptForRemoteDebug);
FPlatformMisc::SetShouldPromptForRemoteDebugOnEnsure(bPromptForRemoteDebugOnEnsure);
// Feedback context.
if (FParse::Param(FCommandLine::Get(), TEXT("WARNINGSASERRORS")))
{
GWarn->TreatWarningsAsErrors = true;
}