FGenericCrashContext

Contains a runtime crash's properties that are common for all platforms.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

FGenericCrashContext

FUnixCrashContext

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/GenericPlatform/GenericPlatformCrashContext.h

Include

#include "GenericPlatform/GenericPlatformCrashContext.h"

Syntax

struct FGenericCrashContext

Remarks

Contains a runtime crash's properties that are common for all platforms. This may change in the future.

Variables

Name Description

Protected variable

TArray< FCrashS...

 

CallStack

Protected variable

uint32

 

CrashedThreadId

Protected variable

const TCHAR ...

 

ErrorMessage

Protected variable

int

 

NumMinidumpFramesToIgnore

Protected variable

FProcHandle

 

ProcessHandle

Protected variable

TArray< FThread...

 

ThreadCallStacks

Protected variable

ECrashContextTy...

 

Type

Constructors

Name Description

Public function

FGenericCrashContext

(
    ECrashContextType InType,
    const TCHAR* ErrorMessage
)

Default constructor.

Destructors

Name Description

Public function Virtual

~FGenericCrashContext()

Functions

Name Description

Public function Const

void

 

AddCrashProperty

(
    const TCHAR* PropertyName,
    const Type& Value
)

Public function Static

void

 

AddPlugin

(
    const FString& PluginDesc
)

Adds a plugin descriptor string to the enabled plugins list in the crash context

Public function Virtual

void

 

AddPortableThreadCallStack

(
    uint32 ThreadId,
    const TCHAR* ThreadName,
    const uint64* StackFrames,
    int32 NumStackFrames
)

Adds a portable callstack for a thread

Public function Static

void

 

AppendEscapedXMLString

(
    FString& OutBuffer,
    const TCHAR* Text
)

Escapes and appends specified text to XML string

Public function

void

 

CapturePortableCallStack

(
    void* ErrorProgramCounter,
    void* Context
)

Generate raw call stack for crash report (image base + offset)

Public function

void

 

CapturePortableCallStack

(
    int32 NumStackFramesToIgnore,
    void* Context
)

Public function Static

void

 

CleanupPlatformSpecificFiles()

Cleanup platform specific files - called on startup, implemented per platform

Public function Static

void

 

CleanupTempSessionContextFiles

(
    const FTimespan& ExpirationAge
)

Clean up expired context files that were left-over on the user disks (because the consumer crashed and/or failed to delete it).

Public function Virtual

void

 

CopyPlatformSpecificFiles

(
    const TCHAR* OutputDirectory,
    void* Context
)

Allows platform implementations to copy files to report directory.

Public function Static

void

 

CopySharedCrashContext

(
    FSharedCrashContext& Dst
)

Initializes a shared crash context from current state. Will not set all fields in Dst.

Public function Static

bool

 

CreateCrashReportDirectory

(
    const TCHAR* CrashGUIDRoot,
    int32 CrashIndex,
    FString& OutCrashDirectoryAbsolute
)

Attempts to create the output report directory.

Public function Static

void

 

DumpAdditionalContext

(
    const TCHAR* CrashFolderAbsolu...
)

Collects additional crash context providers. See FAdditionalCrashContextStack.

Public function Static

FString

 

DumpLog

(
    const FString& CrashFolderAbsolute
)

Flushes the logs.

Public function Const

const FStrin...

 

GetBuffer()

Protected function Virtual Const

const TCHAR ...

 

GetCallstackProperty()

Allow platform implementations to provide a callstack property.

Public function Static

const TCHAR ...

 

GetCrashConfigFilePath()

Helper to get the crash report client config filepath saved by this instance and copied to each crash report folder.

Public function Static

const TCHAR ...

 

GetCrashConfigFolder()

Helper to get the crash report client config folder used by GetCrashConfigFilePath().

Public function Static

FString

 

GetCrashGameName()

Get the Game Name of the crash

Public function Static

const TCHAR ...

 

GetCrashTypeString

(
    ECrashContextType Type
)

Helper to get the standard string for the crash type based on crash event bool values.

Protected function Static

const FStrin...

 

GetEngineData

(
    const FString& Key
)

Get arbitrary engine data from the crash context

Protected function Static

const FStrin...

 

GetGameData

(
    const FString& Key
)

Get arbitrary game data from the crash context

Public function Static

TOptional< i...

 

GetOutOfProcessCrashReporterExitCode()

Return the out-of-process crash reporter exit code if available.

Public function Static

uint32

 

GetOutOfProcessCrashReporterProcessId()

Protected function Virtual Const

bool

 

GetPlatformAllThreadContextsString

(
    FString& OutStr
)

  • a stream of Thread XML elements containing info (e.g. callstack) specific to an active thread

Public function Virtual Const

void

 

GetPortableCallStack

(
    const uint64* StackFrames,
    int32 NumStackFrames,
    TArray< FCrashStackFrame >& OutCal...
)

Gets the portable callstack to a specified stack and puts it into OutCallStack

Public function Static

FString

 

GetTempSessionContextFilePath

(
    uint64 ProcessID
)

Get the file path to the temporary session context file that we create for the given process.

Public function Const

ECrashContex...

 

GetType()

Public function Const

void

 

GetUniqueCrashName

(
    TCHAR* GUIDBuffer,
    int32 BufferSize
)

Public function Static

void

 

Initialize()

Initializes crash context related platform specific data that can be impossible to obtain after a crash.

Public function Static

void

 

InitializeFromContext

(
    const FSessionContext& Context,
    const TCHAR* EnabledPlugins,
    const TCHAR* EngineData,
    const TCHAR* GameData
)

Initialized crash context, using a crash context (e.g. shared from another process).

Public function Const

const bool

 

IsFullCrashDump()

Public function Static

bool

 

IsInitalized()

Public function Static

bool

 

IsOutOfProcessCrashReporter()

Public function Static

bool

 

IsTypeContinuable

(
    ECrashContextType Type
)

Public function Static

void

 

PurgeOldCrashConfig()

Helper to clean out old files in the crash report client config folder.

Public function Static

void

 

ResetEngineData()

Clears the engine data dictionary

Public function Static

void

 

ResetGameData()

Clears the game data dictionary

Public function Virtual Const

void

 

SerializeAsXML

(
    const TCHAR* Filename
)

Serializes crash's informations to the specified filename.

Public function Const

void

 

SerializeContentToBuffer()

Serializes all data to the buffer.

Public function Static

void

 

SerializeSessionContext

(
    FString& Buffer
)

Serializes session context to the given buffer.

Public function

void

 

SetCrashedProcess

(
    const FProcHandle& Process
)

Sets the process id to that has crashed.

Public function

void

 

SetCrashedThreadId

(
    uint32 InId
)

Stores crashing thread id.

Public function Static

void

 

SetCrashTrigger

(
    ECrashTrigger Type
)

Sets the type of crash triggered. Used to distinguish crashes caused for debugging purposes.

Public function Static

void

 

SetDeploymentName

(
    const FString& EpicApp
)

Set the current deployment name (ie. EpicApp)

Public function Static

void

 

SetEngineData

(
    const FString& Key,
    const FString& Value
)

Updates (or adds if not already present) arbitrary engine data to the crash context (will remove the key if passed an empty string)

Public function Static

void

 

SetEngineExit

(
    bool bIsRequestExit
)

Notify the crash context exit has been requested.

Public function Static

void

 

SetGameData

(
    const FString& Key,
    const FString& Value
)

Updates (or adds if not already present) arbitrary game data to the crash context (will remove the key if passed an empty string)

Public function Static

void

 

SetMemoryStats

(
    const FPlatformMemoryStats& Memory...
)

We can't gather memory stats in crash handling function, so we gather them just before raising exception and use in crash reporting.

Public function

void

 

SetNumMinidumpFramesToIgnore

(
    int32 InNumMinidumpFramesToIgnore
)

Sets the number of stack frames to ignore when symbolicating from a minidump

Public function Static

void

 

SetOutOfProcessCrashReporterExitCode

(
    int32 ExitCode
)

Set the out of process crash reporter exit code if known.

Public function Static

void

 

SetOutOfProcessCrashReporterPid

(
    uint32 ProcessId
)

Set whether or not the out-of-process crash reporter is running.

Public function Virtual

void

 

SetPortableCallStack

(
    const uint64* StackFrames,
    int32 NumStackFrames
)

Sets the portable callstack to a specified stack

Public function Static

FString

 

UnescapeXMLString

(
    const FString& Text
)

Unescapes a specified XML string, naive implementation.

Constants

Name

Description

bIsInitialized

Whether the Initialize() has been called

ConfigSectionName

CrashConfigExtension

CrashConfigFileNameA

CrashConfigFileNameW

CrashConfigPurgeDays

CrashContextExtension

CrashContextRuntimeXMLNameA

CrashContextRuntimeXMLNameW

CrashGUIDLength

CrashGUIDRootPrefix

CrashTypeAbnormalShutdown

CrashTypeAssert

CrashTypeCrash

CrashTypeEnsure

CrashTypeGPU

CrashTypeHang

CrashTypeStall

EnabledPluginsTag

EngineDataTag

EngineModeExDirty

EngineModeExUnknown

EngineModeExVanilla

ExecutionGuid

A guid that identifies this particular execution. Allows multiple crash reports from the same run of the project to be tied together.

GameDataTag

NewLineTag

OutOfProcessCrashReporterExitCode

The out of process crash reporter exit code, if available.

OutOfProcessCrashReporterPid

The ID of the external process reporting crashes if the platform supports it and was configured to use it, zero otherwise (0 is a reserved system process ID, invalid for the out of process reporter).

PlatformPropertiesTag

RuntimePropertiesTag

StaticCrashContextIndex

Static counter records how many crash contexts have been constructed

UEMinidumpName