Ark Server API (ASA) - Wiki
|
#include <GenericPlatformCrashContext.h>
Protected Member Functions | |
virtual bool | GetPlatformAllThreadContextsString (FString &OutStr) const |
virtual const TCHAR * | GetCallstackProperty () const |
Static Protected Member Functions | |
static const FString * | GetEngineData (const FString &Key) |
static const FString * | GetGameData (const FString &Key) |
Protected Attributes | |
FProcHandle | ProcessHandle |
ECrashContextType | Type |
uint32 | CrashedThreadId |
const TCHAR * | ErrorMessage |
int | NumMinidumpFramesToIgnore |
TArray< FCrashStackFrame > | CallStack |
TArray< FThreadStackFrames > | ThreadCallStacks |
TArray< FStackWalkModuleInfo > | ModulesInfo |
Private Member Functions | |
virtual void | AddPlatformSpecificProperties () const |
void | AddPortableCallStack () const |
void | AddPortableCallStackHash () const |
void | AddModules () const |
FGenericCrashContext (const FGenericCrashContext &)=delete | |
FGenericCrashContext & | operator= (const FGenericCrashContext &)=delete |
Static Private Member Functions | |
static void | SerializeTempCrashContextToFile () |
static void | SerializeUserSettings (FString &Buffer) |
static void | AddCrashPropertyInternal (FString &Buffer, FStringView PropertyName, FStringView PropertyValue) |
template<typename Type > | |
static void | AddCrashPropertyInternal (FString &Buffer, FStringView PropertyName, const Type &Value) |
static void | AddHeader (FString &Buffer) |
static void | AddFooter (FString &Buffer) |
static void | BeginSection (FString &Buffer, const TCHAR *SectionName) |
static void | EndSection (FString &Buffer, const TCHAR *SectionName) |
static void | InitializeFromConfig () |
static void | UpdateLocalizedStrings () |
Private Attributes | |
FString | CommonBuffer |
int32 | CrashContextIndex |
Contains a runtime crash's properties that are common for all platforms. This may change in the future.
Definition at line 266 of file GenericPlatformCrashContext.h.
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.
|
inlinevirtual |
Definition at line 366 of file GenericPlatformCrashContext.h.
|
privatedelete |
|
inline |
Definition at line 405 of file GenericPlatformCrashContext.h.
|
inlinestaticprivate |
Writes a common property to the buffer.
Definition at line 599 of file GenericPlatformCrashContext.h.
|
staticprivate |
Writes a common property to the buffer.
Writes footer to the buffer.
Writes header information to the buffer.
|
private |
Add module/pdb information to the crash report xml
Serializes platform specific properties to the buffer.
Reimplemented in FWindowsPlatformCrashContext.
Adds a plugin descriptor string to the enabled plugins list in the crash context
|
private |
Add callstack information to the crash report xml
|
private |
Produces a hash based on the offsets of the portable callstack and adds it to the xml
|
virtual |
Adds a portable callstack for a thread
Reimplemented in FMicrosoftPlatformCrashContext.
|
static |
Escapes and appends specified text to XML string
|
static |
|
static |
|
staticprivate |
void FGenericCrashContext::CapturePortableCallStack | ( | int32 | NumStackFramesToIgnore, |
void * | Context ) |
Generate raw call stack for crash report (image base + offset) for the calling thread
ErrorProgramCounter | The program counter of where the occur occurred in the callstack being captured |
Context | Optional thread context information |
Generate raw call stack for crash report (image base + offset) for a different thread
InThreadId | The thread id of the thread to capture the callstack for |
Context | Optional thread context information |
Cleanup platform specific files - called on startup, implemented per platform
|
static |
Clean up expired context files that were left-over on the user disks (because the consumer crashed and/or failed to delete it).
|
virtual |
Allows platform implementations to copy files to report directory.
Reimplemented in FWindowsPlatformCrashContext.
|
static |
Initializes a shared crash context from current state. Will not set all fields in Dst.
|
static |
Attempts to create the output report directory.
Collects additional crash context providers. See FAdditionalCrashContextStack.
Flushes the logs. In the case of in memory logs is used on this configuration, dumps them to file. Returns the name of the file
|
staticprivate |
Definition at line 380 of file GenericPlatformCrashContext.h.
Allow platform implementations to provide a callstack property. Primarily used when non-native code triggers a crash.
Helper to get the crash report client config filepath saved by this instance and copied to each crash report folder.
Helper to get the crash report client config folder used by GetCrashConfigFilePath().
|
static |
Helper to get the standard string for the crash type based on crash event bool values.
Get arbitrary engine data from the crash context
Get arbitrary game data from the crash context
|
virtual |
Gets info about loaded modules and stores it in the given array
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.
Definition at line 332 of file GenericPlatformCrashContext.h.
|
inlineprotectedvirtual |
@OutStr - a stream of Thread XML elements containing info (e.g. callstack) specific to an active thread
Reimplemented in FMicrosoftPlatformCrashContext.
Definition at line 566 of file GenericPlatformCrashContext.h.
|
virtual |
Gets the portable callstack to a specified stack and puts it into OutCallStack
Get the file path to the temporary session context file that we create for the given process.
|
inline |
Definition at line 533 of file GenericPlatformCrashContext.h.
Initializes crash context related platform specific data that can be impossible to obtain after a crash.
Called once when GConfig is initialized. Opportunity to cache values from config.
|
static |
Initialized crash context, using a crash context (e.g. shared from another process).
Definition at line 315 of file GenericPlatformCrashContext.h.
Definition at line 324 of file GenericPlatformCrashContext.h.
|
inlinestatic |
Definition at line 538 of file GenericPlatformCrashContext.h.
|
inlinestatic |
Delegate for additional crash context.
Definition at line 471 of file GenericPlatformCrashContext.h.
|
privatedelete |
Helper to clean out old files in the crash report client config folder.
Serializes crash's informations to the specified filename. Should be overridden for platforms where using FFileHelper is not safe, all POSIX platforms.
void FGenericCrashContext::SerializeContentToBuffer | ( | ) | const |
Serializes all data to the buffer.
Serializes session context to the given buffer. NOTE: Assumes that the buffer already has a header and section open.
Serializes the session context section of the crash context to a temporary file.
Serializes the current user setting struct to a buffer.
|
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.
Definition at line 478 of file GenericPlatformCrashContext.h.
Stores crashing thread id.
Definition at line 484 of file GenericPlatformCrashContext.h.
|
static |
Sets the type of crash triggered. Used to distinguish crashes caused for debugging purposes.
Set the current deployment name (ie. EpicApp)
|
static |
Updates (or adds if not already present) arbitrary engine data to the crash context (will remove the key if passed an empty string)
Notify the crash context exit has been requested.
Updates (or adds if not already present) arbitrary game data to the crash context (will remove the key if passed an empty string)
|
static |
We can't gather memory stats in crash handling function, so we gather them just before raising exception and use in crash reporting.
Sets the number of stack frames to ignore when symbolicating from a minidump
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.
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.
Definition at line 343 of file GenericPlatformCrashContext.h.
|
virtual |
Sets the portable callstack to a specified stack
Reimplemented in FMicrosoftPlatformCrashContext.
Unescapes a specified XML string, naive implementation.
Called to update any localized strings in the crash context
|
staticprivate |
Delegate for additional crash context.
Definition at line 645 of file GenericPlatformCrashContext.h.
|
staticprivate |
Whether the Initialize() has been called
Definition at line 632 of file GenericPlatformCrashContext.h.
|
protected |
Definition at line 573 of file GenericPlatformCrashContext.h.
|
mutableprivate |
The buffer used to store the crash's properties.
Definition at line 649 of file GenericPlatformCrashContext.h.
Definition at line 276 of file GenericPlatformCrashContext.h.
Definition at line 275 of file GenericPlatformCrashContext.h.
Definition at line 273 of file GenericPlatformCrashContext.h.
Definition at line 274 of file GenericPlatformCrashContext.h.
Definition at line 277 of file GenericPlatformCrashContext.h.
Definition at line 280 of file GenericPlatformCrashContext.h.
|
private |
Records which crash context we were using the StaticCrashContextIndex counter
Definition at line 652 of file GenericPlatformCrashContext.h.
Definition at line 270 of file GenericPlatformCrashContext.h.
Definition at line 271 of file GenericPlatformCrashContext.h.
|
protected |
Definition at line 570 of file GenericPlatformCrashContext.h.
Definition at line 288 of file GenericPlatformCrashContext.h.
Definition at line 278 of file GenericPlatformCrashContext.h.
Definition at line 296 of file GenericPlatformCrashContext.h.
Definition at line 291 of file GenericPlatformCrashContext.h.
Definition at line 290 of file GenericPlatformCrashContext.h.
Definition at line 292 of file GenericPlatformCrashContext.h.
Definition at line 294 of file GenericPlatformCrashContext.h.
Definition at line 295 of file GenericPlatformCrashContext.h.
Definition at line 297 of file GenericPlatformCrashContext.h.
Definition at line 293 of file GenericPlatformCrashContext.h.
Definition at line 285 of file GenericPlatformCrashContext.h.
Definition at line 283 of file GenericPlatformCrashContext.h.
Definition at line 300 of file GenericPlatformCrashContext.h.
Definition at line 299 of file GenericPlatformCrashContext.h.
Definition at line 301 of file GenericPlatformCrashContext.h.
|
protected |
Definition at line 571 of file GenericPlatformCrashContext.h.
Definition at line 304 of file GenericPlatformCrashContext.h.
Definition at line 284 of file GenericPlatformCrashContext.h.
|
protected |
Definition at line 575 of file GenericPlatformCrashContext.h.
Definition at line 287 of file GenericPlatformCrashContext.h.
|
protected |
Definition at line 572 of file GenericPlatformCrashContext.h.
The out of process crash reporter exit code, if available. The 32 MSB indicates if the exit code is set and the 32 LSB contains the exit code. The value can be read/write from different threads.
Definition at line 638 of file GenericPlatformCrashContext.h.
|
staticprivate |
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).
Definition at line 635 of file GenericPlatformCrashContext.h.
Definition at line 282 of file GenericPlatformCrashContext.h.
|
protected |
Definition at line 568 of file GenericPlatformCrashContext.h.
Definition at line 281 of file GenericPlatformCrashContext.h.
|
staticprivate |
Static counter records how many crash contexts have been constructed
Definition at line 641 of file GenericPlatformCrashContext.h.
|
protected |
Definition at line 574 of file GenericPlatformCrashContext.h.
|
protected |
Definition at line 569 of file GenericPlatformCrashContext.h.
Definition at line 286 of file GenericPlatformCrashContext.h.