renderdoc.EnableCrashHandler
renderdoc.EnableCrashHandler
#Overview
name: renderdoc.EnableCrashHandler
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0 - Crash handling is completely delegated to the engine. 1 - The RenderDoc crash handler will be used (Only use this if you know the problem is with RenderDoc and you want to notify the RenderDoc developers!).
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of renderdoc.EnableCrashHandler is to control the crash handling behavior when using the RenderDoc debugging tool in Unreal Engine 5. It determines whether the crash handling should be delegated to the engine or if RenderDoc’s own crash handler should be used.
This setting variable is primarily used by the RenderDoc plugin, which is part of the developer tools in Unreal Engine 5. The plugin is responsible for integrating RenderDoc, a graphics debugging tool, into the Unreal Engine environment.
The value of this variable is set through a console variable (CVar) named CVarRenderDocEnableCrashHandler. It is defined in the RenderDocPluginLoader.cpp file within the RenderDocPlugin module. The default value is 0, which means crash handling is delegated to the engine by default.
The associated variable CVarRenderDocEnableCrashHandler directly interacts with renderdoc.EnableCrashHandler. They share the same value and purpose.
Developers must be aware that enabling RenderDoc’s crash handler (by setting the value to 1) should only be done when they are certain that the problem is within RenderDoc itself and they want to notify the RenderDoc developers. In most cases, it’s recommended to leave this setting at its default value of 0.
Best practices when using this variable include:
- Keep it at the default value (0) unless specifically troubleshooting RenderDoc-related issues.
- Only enable it (set to 1) when you’re confident that the crash is caused by RenderDoc and you want to report it to the RenderDoc team.
- Remember to disable it after debugging RenderDoc-specific issues to ensure normal engine crash handling behavior.
Regarding the associated variable CVarRenderDocEnableCrashHandler:
The purpose of CVarRenderDocEnableCrashHandler is to provide a programmatic way to access and modify the renderdoc.EnableCrashHandler setting within the C++ code of the RenderDoc plugin.
This variable is used within the RenderDocPlugin module, specifically in the RenderDocPluginLoader.cpp file. It’s used to check the current setting and determine whether to unload RenderDoc’s crash handler.
The value of CVarRenderDocEnableCrashHandler is set when the console variable is defined, but it can be changed at runtime through the console or programmatically.
CVarRenderDocEnableCrashHandler directly interacts with the renderdoc.EnableCrashHandler setting, effectively serving as its in-code representation.
Developers should be aware that this variable is used to control RenderDoc’s crash handler behavior at runtime. It’s checked when loading the RenderDoc library to determine whether to unload the crash handler.
Best practices for using CVarRenderDocEnableCrashHandler include:
- Use GetValueOnAnyThread() to safely read its value from any thread.
- Consider the implications of changing this value at runtime, as it affects crash handling behavior.
- Use this variable when you need programmatic control over RenderDoc’s crash handler within your custom code that interacts with the RenderDoc plugin.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Developer/RenderDocPlugin/Source/RenderDocPlugin/Private/RenderDocPluginLoader.cpp:28
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarRenderDocEnableCrashHandler(
TEXT("renderdoc.EnableCrashHandler"),
0,
TEXT("0 - Crash handling is completely delegated to the engine. ")
TEXT("1 - The RenderDoc crash handler will be used (Only use this if you know the problem is with RenderDoc and you want to notify the RenderDoc developers!)."));
// On Linux, the renderdoc tree is set up like:
// /home/user/dev/renderdoc_1.18/bin/qrenderdoc
#Associated Variable and Callsites
This variable is associated with another variable named CVarRenderDocEnableCrashHandler
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Plugins/Developer/RenderDocPlugin/Source/RenderDocPlugin/Private/RenderDocPluginLoader.cpp:27
Scope: file
Source code excerpt:
TEXT("RenderDoc will attach on startup."));
static TAutoConsoleVariable<int32> CVarRenderDocEnableCrashHandler(
TEXT("renderdoc.EnableCrashHandler"),
0,
TEXT("0 - Crash handling is completely delegated to the engine. ")
TEXT("1 - The RenderDoc crash handler will be used (Only use this if you know the problem is with RenderDoc and you want to notify the RenderDoc developers!)."));
// On Linux, the renderdoc tree is set up like:
#Loc: <Workspace>/Engine/Plugins/Developer/RenderDocPlugin/Source/RenderDocPlugin/Private/RenderDocPluginLoader.cpp:97
Scope (from outer to inner):
file
function static void* LoadAndCheckRenderDocLibrary
Source code excerpt:
//Unregister crash handler unless the user has enabled it. This is to avoid sending unneccesary crash reports to Baldur.
if (!CVarRenderDocEnableCrashHandler.GetValueOnAnyThread())
{
RenderDocAPI->UnloadCrashHandler();
}
int MajorVersion(0), MinorVersion(0), PatchVersion(0);
RenderDocAPI->GetAPIVersion(&MajorVersion, &MinorVersion, &PatchVersion);