engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | Protected 成员函数 | 所有成员列表
FGenericCrashContext结构体 参考

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

#include <GenericPlatformCrashContext.h>

+ 类 FGenericCrashContext 继承关系图:

Public 成员函数

virtual void AddPortableThreadCallStack (uint32 ThreadId, const TCHAR *ThreadName, const uint64 *StackFrames, int32 NumStackFrames)
 Adds a portable callstack for a thread
 
void CapturePortableCallStack (int32 NumStackFramesToIgnore, void *Context)
 Generate raw call stack for crash report (image base + offset)
 
virtual void CopyPlatformSpecificFiles (const TCHAR *OutputDirectory, void *Context)
 Allows platform implementations to copy files to report directory.
 
 FGenericCrashContext (ECrashContextType InType, const TCHAR *ErrorMessage)
 Default constructor. 更多...
 
const FString & GetBuffer () const
 
virtual void GetPortableCallStack (const uint64 *StackFrames, int32 NumStackFrames, TArray< FCrashStackFrame > &OutCallStack) const
 Gets the portable callstack to a specified stack and puts it into OutCallStack
 
ECrashContextType GetType () const
 
void GetUniqueCrashName (TCHAR *GUIDBuffer, int32 BufferSize) const
 
const bool IsFullCrashDump () const
 
virtual void SerializeAsXML (const TCHAR *Filename) const
 Serializes crash's informations to the specified filename. 更多...
 
void SerializeContentToBuffer () const
 Serializes all data to the buffer.
 
void SetCrashedProcess (const FProcHandle &Process)
 Sets the process id to that has crashed. 更多...
 
void SetCrashedThreadId (uint32 InId)
 Stores crashing thread id.
 
void SetNumMinidumpFramesToIgnore (int32 InNumMinidumpFramesToIgnore)
 Sets the number of stack frames to ignore when symbolicating from a minidump
 
virtual void SetPortableCallStack (const uint64 *StackFrames, int32 NumStackFrames)
 Sets the portable callstack to a specified stack
 

静态 Public 成员函数

static void AddPlugin (const FString &PluginDesc)
 Adds a plugin descriptor string to the enabled plugins list in the crash context
 
static void AppendEscapedXMLString (FString &OutBuffer, const TCHAR *Text)
 Escapes and appends specified text to XML string
 
static void CleanupPlatformSpecificFiles ()
 Cleanup platform specific files - called on startup, implemented per platform
 
static void CopySharedCrashContext (FSharedCrashContext &Dst)
 Initializes a shared crash context from current state. 更多...
 
static bool CreateCrashReportDirectory (const TCHAR *CrashGUIDRoot, int32 CrashIndex, FString &OutCrashDirectoryAbsolute)
 Attempts to create the output report directory.
 
static void DumpLog (const FString &CrashFolderAbsolute)
 Flushes the logs. 更多...
 
static const TCHAR * GetCrashConfigFilePath ()
 Helper to get the crash report client config filepath saved by this instance and copied to each crash report folder.
 
static const TCHAR * GetCrashConfigFolder ()
 Helper to get the crash report client config folder used by GetCrashConfigFilePath().
 
static FString GetCrashGameName ()
 Get the Game Name of the crash
 
static const TCHAR * GetCrashTypeString (ECrashContextType Type)
 Helper to get the standard string for the crash type based on crash event bool values.
 
static TOptional< int32 > GetOutOfProcessCrashReporterExitCode ()
 Return the out-of-process crash reporter exit code if available. 更多...
 
static uint32 GetOutOfProcessCrashReporterProcessId ()
 
static FString GetTempSessionContextFilePath (uint64 ProcessID)
 Get the file path to the temporary session context file that we create for the given process.
 
static void Initialize ()
 Initializes crash context related platform specific data that can be impossible to obtain after a crash.
 
static void InitializeFromContext (const FSessionContext &Context, const TCHAR *EnabledPlugins, const TCHAR *EngineData, const TCHAR *GameData)
 Initialized crash context, using a crash context (e.g. 更多...
 
static bool IsInitalized ()
 
static bool IsOutOfProcessCrashReporter ()
 
static void PurgeOldCrashConfig ()
 Helper to clean out old files in the crash report client config folder.
 
static void ResetEngineData ()
 Clears the engine data dictionary
 
static void ResetGameData ()
 Clears the game data dictionary
 
static void SerializeSessionContext (FString &Buffer)
 Serializes session context to the given buffer. 更多...
 
static void SetCrashTrigger (ECrashTrigger Type)
 Sets the type of crash triggered. 更多...
 
static void SetDeploymentName (const FString &EpicApp)
 Set the current deployment name (ie. 更多...
 
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)
 
static void SetEngineExit (bool bIsRequestExit)
 Notify the crash context exit has been requested.
 
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)
 
static void SetMemoryStats (const FPlatformMemoryStats &MemoryStats)
 We can't gather memory stats in crash handling function, so we gather them just before raising exception and use in crash reporting.
 
static void SetOutOfProcessCrashReporterExitCode (int32 ExitCode)
 Set the out of process crash reporter exit code if known. 更多...
 
static void SetOutOfProcessCrashReporterPid (uint32 ProcessId)
 Set whether or not the out-of-process crash reporter is running. 更多...
 
static FString UnescapeXMLString (const FString &Text)
 Unescapes a specified XML string, naive implementation.
 

Protected 成员函数

virtual const TCHAR * GetCallstackProperty () const
 Allow platform implementations to provide a callstack property. 更多...
 
virtual bool GetPlatformAllThreadContextsString (FString &OutStr) const
 @OutStr - a stream of Thread XML elements containing info (e.g. 更多...
 

详细描述

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

This may change in the future.

构造及析构函数说明

◆ FGenericCrashContext()

FGenericCrashContext::FGenericCrashContext ( ECrashContextType  InType,
const TCHAR *  ErrorMessage 
)

Default constructor.

Optionally pass a process handle if building a crash context for a process other then current.

成员函数说明

◆ CopySharedCrashContext()

static void FGenericCrashContext::CopySharedCrashContext ( FSharedCrashContext &  Dst)
static

Initializes a shared crash context from current state.

Will not set all fields in Dst.

◆ DumpLog()

static void FGenericCrashContext::DumpLog ( const FString &  CrashFolderAbsolute)
static

Flushes the logs.

In the case of in memory logs is used on this configuration, dumps them to file.

◆ GetBuffer()

const FString & FGenericCrashContext::GetBuffer ( ) const
inline
返回
the buffer containing serialized data.

◆ GetCallstackProperty()

virtual const TCHAR * FGenericCrashContext::GetCallstackProperty ( ) const
protectedvirtual

Allow platform implementations to provide a callstack property.

Primarily used when non-native code triggers a crash.

◆ GetOutOfProcessCrashReporterExitCode()

static TOptional< int32 > FGenericCrashContext::GetOutOfProcessCrashReporterExitCode ( )
static

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

The exit code is available if crash reporter process died while the application it monitors was still running. Then engine periodically poll the health of the crash reporter process and try to read its exit code if it unexpectedly died.

注解
This function is useful to try diagnose why the crash reporter died (crashed/killed/asserted) and gather data for the analytics.

◆ GetOutOfProcessCrashReporterProcessId()

static uint32 FGenericCrashContext::GetOutOfProcessCrashReporterProcessId ( )
inlinestatic
返回
a non-zero value if crash reporter process is used to monitor the session, capture the call stack and write the minidump, otherwise, this is done inside the crashing process.

◆ GetPlatformAllThreadContextsString()

virtual bool FGenericCrashContext::GetPlatformAllThreadContextsString ( FString &  OutStr) const
inlineprotectedvirtual

@OutStr - a stream of Thread XML elements containing info (e.g.

callstack) specific to an active thread

返回
- whether the operation was successful

◆ GetType()

ECrashContextType FGenericCrashContext::GetType ( ) const
inline
返回
whether this crash is a non-crash event

◆ GetUniqueCrashName()

void FGenericCrashContext::GetUniqueCrashName ( TCHAR *  GUIDBuffer,
int32  BufferSize 
) const
返回
a globally unique crash name.

◆ InitializeFromContext()

static void FGenericCrashContext::InitializeFromContext ( const FSessionContext &  Context,
const TCHAR *  EnabledPlugins,
const TCHAR *  EngineData,
const TCHAR *  GameData 
)
static

Initialized crash context, using a crash context (e.g.

shared from another process).

◆ IsFullCrashDump()

const bool FGenericCrashContext::IsFullCrashDump ( ) const
返回
whether this crash is a full memory minidump

◆ IsInitalized()

static bool FGenericCrashContext::IsInitalized ( )
inlinestatic
返回
true, if the generic crash context has been initialized.

◆ IsOutOfProcessCrashReporter()

static bool FGenericCrashContext::IsOutOfProcessCrashReporter ( )
inlinestatic
返回
true if walking the crashed call stack and writing the minidump is being handled out-of-process.
注解
The reporting itself (showing the crash UI and sending the report is always done out of process)

◆ SerializeAsXML()

virtual void FGenericCrashContext::SerializeAsXML ( const TCHAR *  Filename) const
virtual

Serializes crash's informations to the specified filename.

Should be overridden for platforms where using FFileHelper is not safe, all POSIX platforms.

◆ SerializeSessionContext()

static void FGenericCrashContext::SerializeSessionContext ( FString &  Buffer)
static

Serializes session context to the given buffer.

NOTE: Assumes that the buffer already has a header and section open.

◆ SetCrashedProcess()

void FGenericCrashContext::SetCrashedProcess ( const FProcHandle &  Process)
inline

Sets the process id to that has crashed.

On supported platforms this will analyze the given process rather than current. Default is current process.

◆ SetCrashTrigger()

static void FGenericCrashContext::SetCrashTrigger ( ECrashTrigger  Type)
static

Sets the type of crash triggered.

Used to distinguish crashes caused for debugging purposes.

◆ SetDeploymentName()

static void FGenericCrashContext::SetDeploymentName ( const FString &  EpicApp)
static

Set the current deployment name (ie.

EpicApp)

◆ SetOutOfProcessCrashReporterExitCode()

static void FGenericCrashContext::SetOutOfProcessCrashReporterExitCode ( int32  ExitCode)
static

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

The out of process reporter is expected to run in background, waiting for a signal to handle a crashes/ensures/assert, but sometimes it crashes. If the engine detects that its associated out of process crash reporter died and if the child process exit code can be retrieved, it can be exposed through this function.

参见
GetOutOfProcessCrashReporterExitCode

◆ SetOutOfProcessCrashReporterPid()

static void FGenericCrashContext::SetOutOfProcessCrashReporterPid ( uint32  ProcessId)
inlinestatic

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

A non-zero process id means that crash artifacts like the call stack and then minidump are built in a separated background process. The reporting itself, i.e. packaging and sending the crash artifacts is always done out of process.

注解
CrashReportClient (CrashReportClientEditor for the Editor) can be configured to wait for crash, capture the crashed process callstack, write the minidump, collect all crash artifacts and send them (out-of-process reporting) or just collect and send them (in-process reporting because the crashing process creates all crash artifacts itself).

该结构体的文档由以下文件生成: