Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FGenericPlatformStackWalk Struct Reference

#include <GenericPlatformStackWalk.h>

+ Inheritance diagram for FGenericPlatformStackWalk:

Classes

struct  EStackWalkFlags
 

Public Types

typedef FGenericPlatformStackWalk Base
 

Static Public Member Functions

static void Init ()
 
static bool InitStackWalking ()
 
static bool InitStackWalkingForProcess (const FProcHandle &Process)
 
static bool ProgramCounterToHumanReadableString (int32 CurrentCallDepth, uint64 ProgramCounter, ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, FGenericCrashContext *Context=nullptr)
 
static bool SymbolInfoToHumanReadableString (const FProgramCounterSymbolInfo &SymbolInfo, ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize)
 
static bool SymbolInfoToHumanReadableStringEx (const FProgramCounterSymbolInfoEx &SymbolInfo, FString &out_HumanReadableString)
 
static void ProgramCounterToSymbolInfo (uint64 ProgramCounter, FProgramCounterSymbolInfo &out_SymbolInfo)
 
static void ProgramCounterToSymbolInfoEx (uint64 ProgramCounter, FProgramCounterSymbolInfoEx &out_SymbolInfo)
 
static uint32 CaptureStackBackTrace (uint64 *BackTrace, uint32 MaxDepth, void *Context=nullptr)
 
static uint32 CaptureThreadStackBackTrace (uint64 ThreadId, uint64 *BackTrace, uint32 MaxDepth, void *Context=nullptr)
 
static FORCENOINLINE void StackWalkAndDump (ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, void *Context=nullptr)
 
static void StackWalkAndDump (ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, void *ProgramCounter, void *Context=nullptr)
 
static TArray< FProgramCounterSymbolInfoGetStack (int32 IgnoreCount, int32 MaxDepth=100, void *Context=nullptr)
 
static void ThreadStackWalkAndDump (ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, uint32 ThreadId)
 
static void StackWalkAndDumpEx (ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, uint32 Flags, void *Context=nullptr)
 
static void StackWalkAndDumpEx (ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, void *ProgramCounter, uint32 Flags, void *Context=nullptr)
 
static FORCEINLINE int32 GetProcessModuleCount ()
 
static FORCEINLINE int32 GetProcessModuleSignatures (FStackWalkModuleInfo *ModuleSignatures, const int32 ModuleSignaturesSize)
 
static TMap< FName, FStringGetSymbolMetaData ()
 

Static Protected Member Functions

static bool WantsDetailedCallstacksInNonMonolithicBuilds ()
 

Detailed Description

Generic implementation for most platforms

Definition at line 105 of file GenericPlatformStackWalk.h.

Member Typedef Documentation

◆ Base

Member Function Documentation

◆ CaptureStackBackTrace()

static uint32 FGenericPlatformStackWalk::CaptureStackBackTrace ( uint64 * BackTrace,
uint32 MaxDepth,
void * Context = nullptr )
static

Capture a stack backtrace and optionally use the passed in exception pointers.

Parameters
BackTrace[out] Pointer to array to take backtrace
MaxDepthEntries in BackTrace array
ContextOptional thread context information

◆ CaptureThreadStackBackTrace()

static uint32 FGenericPlatformStackWalk::CaptureThreadStackBackTrace ( uint64 ThreadId,
uint64 * BackTrace,
uint32 MaxDepth,
void * Context = nullptr )
static

Capture a stack backtrace for a specific thread.

Parameters
ThreadIdID of the thread to trace
BackTrace[out] Pointer to array to take backtrace
MaxDepthEntries in BackTrace array
ContextOptional thread context information

◆ GetProcessModuleCount()

static FORCEINLINE int32 FGenericPlatformStackWalk::GetProcessModuleCount ( )
inlinestatic

Returns the number of modules loaded by the currently running process.

Definition at line 300 of file GenericPlatformStackWalk.h.

◆ GetProcessModuleSignatures()

static FORCEINLINE int32 FGenericPlatformStackWalk::GetProcessModuleSignatures ( FStackWalkModuleInfo * ModuleSignatures,
const int32 ModuleSignaturesSize )
inlinestatic

Gets the signature for every module loaded by the currently running process.

Parameters
ModuleSignaturesAn array to retrieve the module signatures.
ModuleSignaturesSizeThe size of the array pointed to by ModuleSignatures.
Returns
The number of modules copied into ModuleSignatures

Definition at line 313 of file GenericPlatformStackWalk.h.

◆ GetStack()

static TArray< FProgramCounterSymbolInfo > FGenericPlatformStackWalk::GetStack ( int32 IgnoreCount,
int32 MaxDepth = 100,
void * Context = nullptr )
static

Walks the stack and updates the Stack array with the symbol information for each line in the stack.

Parameters
IgnoreCountNumber of stack entries to ignore (some are guaranteed to be in the stack walking code)
MaxDepthThe maximum depth to trace, can't be more than 100, offset from IgnoreCount.
ContextOptional thread context information
Returns
The stack of symbols to return.

◆ GetSymbolMetaData()

static TMap< FName, FString > FGenericPlatformStackWalk::GetSymbolMetaData ( )
static

Gets the meta-data associated with all symbols of this target. This may include things that are needed to perform further offline processing of symbol information (eg, the source binary).

Returns
A map containing the meta-data (if any).

◆ Init()

static void FGenericPlatformStackWalk::Init ( )
static

Initializes options related to stack walking from ini, i.e. how detailed the stack walking should be, performance settings etc.

◆ InitStackWalking()

static bool FGenericPlatformStackWalk::InitStackWalking ( )
inlinestatic

Initializes stack traversal and symbol. Must be called before any other stack/symbol functions. Safe to reenter.

Definition at line 132 of file GenericPlatformStackWalk.h.

◆ InitStackWalkingForProcess()

static bool FGenericPlatformStackWalk::InitStackWalkingForProcess ( const FProcHandle & Process)
inlinestatic

Like InitStackWalking but initializes stack walking for another process.

Parameters
ProcessProcess that is going to be queried
Returns
True if successful, false otherwise.

Definition at line 142 of file GenericPlatformStackWalk.h.

◆ ProgramCounterToHumanReadableString()

static bool FGenericPlatformStackWalk::ProgramCounterToHumanReadableString ( int32 CurrentCallDepth,
uint64 ProgramCounter,
ANSICHAR * HumanReadableString,
SIZE_T HumanReadableStringSize,
FGenericCrashContext * Context = nullptr )
static

Converts the passed in program counter address to a human readable string and appends it to the passed in one.

Warning
: The code assumes that HumanReadableString is large enough to contain the information.
: Please, do not override this method. Can't be modified or altered without notice.

This method is the same for all platforms to simplify parsing by the crash processor.

Example formatted line:

UE4Editor_Core!FOutputDeviceWindowsErrorSerialize() (0xddf1bae5) + 620 bytes [\engine\source\runtime\core\private\windows\windowsplatformoutputdevices.cpp:110] ModuleName!FunctionName (ProgramCounter) + offset bytes [StrippedFilepath:LineNumber]

Parameters
CurrentCallDepthDepth of the call, if known (-1 if not - note that some platforms may not return meaningful information in the latter case)
ProgramCounterAddress to look symbol information up for
HumanReadableStringString to concatenate information with
HumanReadableStringSizesize of string in characters
ContextPointer to crash context, if any
Returns
true if the symbol was found, otherwise false

◆ ProgramCounterToSymbolInfo()

static void FGenericPlatformStackWalk::ProgramCounterToSymbolInfo ( uint64 ProgramCounter,
FProgramCounterSymbolInfo & out_SymbolInfo )
inlinestatic

Converts the passed in program counter address to a symbol info struct, filling in module and filename, line number and displacement.

Warning
: The code assumes that the destination strings are big enough
Parameters
ProgramCounterAddress to look symbol information up for
out_SymbolInfoSymbol information associated with program counter

Definition at line 198 of file GenericPlatformStackWalk.h.

◆ ProgramCounterToSymbolInfoEx()

static void FGenericPlatformStackWalk::ProgramCounterToSymbolInfoEx ( uint64 ProgramCounter,
FProgramCounterSymbolInfoEx & out_SymbolInfo )
inlinestatic

Same as above, but can be used with external applications since it doesn't re-initialize the active process.

Definition at line 204 of file GenericPlatformStackWalk.h.

◆ StackWalkAndDump() [1/2]

static FORCENOINLINE void FGenericPlatformStackWalk::StackWalkAndDump ( ANSICHAR * HumanReadableString,
SIZE_T HumanReadableStringSize,
int32 IgnoreCount,
void * Context = nullptr )
static

Walks the stack and appends the human readable string to the passed in one.

Warning
: The code assumes that HumanReadableString is large enough to contain the information.
Parameters
HumanReadableStringString to concatenate information with
HumanReadableStringSizesize of string in characters
IgnoreCountNumber of stack entries to ignore (some are guaranteed to be in the stack walking code)
ContextOptional thread context information

◆ StackWalkAndDump() [2/2]

static void FGenericPlatformStackWalk::StackWalkAndDump ( ANSICHAR * HumanReadableString,
SIZE_T HumanReadableStringSize,
void * ProgramCounter,
void * Context = nullptr )
static

Walks the stack and appends the human readable string to the passed in one.

Warning
: The code assumes that HumanReadableString is large enough to contain the information.
Parameters
HumanReadableStringString to concatenate information with
HumanReadableStringSizesize of string in characters
ProgramCounterInstruction address that should be at the top of the stack
ContextOptional thread context information

◆ StackWalkAndDumpEx() [1/2]

static void FGenericPlatformStackWalk::StackWalkAndDumpEx ( ANSICHAR * HumanReadableString,
SIZE_T HumanReadableStringSize,
int32 IgnoreCount,
uint32 Flags,
void * Context = nullptr )
static

Walks the stack and appends the human readable string to the passed in one.

Warning
: The code assumes that HumanReadableString is large enough to contain the information.
Parameters
HumanReadableStringString to concatenate information with
HumanReadableStringSizesize of string in characters
IgnoreCountNumber of stack entries to ignore (some are guaranteed to be in the stack walking code)
FlagsUsed to pass additional information (see StackWalkFlags)
ContextOptional thread context information

◆ StackWalkAndDumpEx() [2/2]

static void FGenericPlatformStackWalk::StackWalkAndDumpEx ( ANSICHAR * HumanReadableString,
SIZE_T HumanReadableStringSize,
void * ProgramCounter,
uint32 Flags,
void * Context = nullptr )
static

Walks the stack and appends the human readable string to the passed in one.

Warning
: The code assumes that HumanReadableString is large enough to contain the information.
Parameters
HumanReadableStringString to concatenate information with
HumanReadableStringSizesize of string in characters
ProgramCounterInstruction address that should be at the top of the stack
FlagsUsed to pass additional information (see StackWalkFlags)
ContextOptional thread context information

◆ SymbolInfoToHumanReadableString()

static bool FGenericPlatformStackWalk::SymbolInfoToHumanReadableString ( const FProgramCounterSymbolInfo & SymbolInfo,
ANSICHAR * HumanReadableString,
SIZE_T HumanReadableStringSize )
static

Converts the passed in symbol information to a human readable string and appends it to the passed in one.

Warning
: The code assumes that HumanReadableString is large enough to contain the information.
: Please, do not override this method. Can't be modified or altered without notice.

This method is the same for all platforms to simplify parsing by the crash processor.

Example formatted line:

UE4Editor_Core!FOutputDeviceWindowsErrorSerialize() (0xddf1bae5) + 620 bytes [\engine\source\runtime\core\private\windows\windowsplatformoutputdevices.cpp:110] ModuleName!FunctionName (ProgramCounter) + offset bytes [StrippedFilepath:LineNumber]

Parameters
SymbolInfoSymbol information
HumanReadableStringString to concatenate information with
HumanReadableStringSizesize of string in characters
ContextPointer to crash context, if any
Returns
true if the symbol was found, otherwise false

◆ SymbolInfoToHumanReadableStringEx()

static bool FGenericPlatformStackWalk::SymbolInfoToHumanReadableStringEx ( const FProgramCounterSymbolInfoEx & SymbolInfo,
FString & out_HumanReadableString )
static

Same as above, but can be used with external applications.

◆ ThreadStackWalkAndDump()

static void FGenericPlatformStackWalk::ThreadStackWalkAndDump ( ANSICHAR * HumanReadableString,
SIZE_T HumanReadableStringSize,
int32 IgnoreCount,
uint32 ThreadId )
inlinestatic

Walks the stack for the specified thread and appends the human readable string to the passed in one.

Warning
: The code assumes that HumanReadableString is large enough to contain the information.
Parameters
HumanReadableStringString to concatenate information with
HumanReadableStringSizesize of string in characters
IgnoreCountNumber of stack entries to ignore (some are guaranteed to be in the stack walking code)
ThreadIdThreadId to walk the strack for.

Definition at line 270 of file GenericPlatformStackWalk.h.

◆ WantsDetailedCallstacksInNonMonolithicBuilds()

static bool FGenericPlatformStackWalk::WantsDetailedCallstacksInNonMonolithicBuilds ( )
staticprotected

Returns true if non-monolithic builds should produce full callstacks in the log (and load all debug symbols)


The documentation for this struct was generated from the following file: