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

Generic implementation for most platforms 更多...

#include <GenericPlatformStackWalk.h>

+ 类 FGenericPlatformStackWalk 继承关系图:

静态 Public 成员函数

static uint32 CaptureStackBackTrace (uint64 *BackTrace, uint32 MaxDepth, void *Context=nullptr)
 Capture a stack backtrace and optionally use the passed in exception pointers. 更多...
 
static uint32 CaptureThreadStackBackTrace (uint64 ThreadId, uint64 *BackTrace, uint32 MaxDepth)
 Capture a stack backtrace for a specific thread. 更多...
 
static FORCEINLINE int32 GetProcessModuleCount ()
 Returns the number of modules loaded by the currently running process.
 
static FORCEINLINE int32 GetProcessModuleSignatures (FStackWalkModuleInfo *ModuleSignatures, const int32 ModuleSignaturesSize)
 Gets the signature for every module loaded by the currently running process. 更多...
 
static TArray< FProgramCounterSymbolInfo > GetStack (int32 IgnoreCount, int32 MaxDepth=100, void *Context=nullptr)
 Walks the stack and updates the Stack array with the symbol information for each line in the stack. 更多...
 
static TMap< FName, FString > GetSymbolMetaData ()
 Gets the meta-data associated with all symbols of this target. 更多...
 
static void Init ()
 Initializes options related to stack walking from ini, i.e. 更多...
 
static bool InitStackWalking ()
 Initializes stack traversal and symbol. 更多...
 
static bool InitStackWalkingForProcess (const FProcHandle &Process)
 Like InitStackWalking but initializes stack walking for another process. 更多...
 
static bool ProgramCounterToHumanReadableString (int32 CurrentCallDepth, uint64 ProgramCounter, ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, FGenericCrashContext *Context=nullptr)
 Converts the passed in program counter address to a human readable string and appends it to the passed in one. 更多...
 
static void ProgramCounterToSymbolInfo (uint64 ProgramCounter, FProgramCounterSymbolInfo &out_SymbolInfo)
 Converts the passed in program counter address to a symbol info struct, filling in module and filename, line number and displacement. 更多...
 
static void StackWalkAndDump (ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, void *Context=nullptr)
 Walks the stack and appends the human readable string to the passed in one. 更多...
 
static void StackWalkAndDumpEx (ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, uint32 Flags, void *Context=nullptr)
 Walks the stack and appends the human readable string to the passed in one. 更多...
 
static bool SymbolInfoToHumanReadableString (const FProgramCounterSymbolInfo &SymbolInfo, ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize)
 Converts the passed in symbol information to a human readable string and appends it to the passed in one. 更多...
 
static bool SymbolInfoToHumanReadableStringEx (const FProgramCounterSymbolInfoEx &SymbolInfo, FString &out_HumanReadableString)
 Same as above, but can be used with external applications.
 
static void ThreadStackWalkAndDump (ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, uint32 ThreadId)
 Walks the stack for the specified thread and appends the human readable string to the passed in one. 更多...
 

静态 Protected 成员函数

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

详细描述

Generic implementation for most platforms

成员函数说明

◆ 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.

参数
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 
)
static

Capture a stack backtrace for a specific thread.

参数
ThreadIdID of the thread to trace
BackTrace[out] Pointer to array to take backtrace
MaxDepthEntries in BackTrace array

◆ GetProcessModuleSignatures()

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

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

参数
ModuleSignaturesAn array to retrieve the module signatures.
ModuleSignaturesSizeThe size of the array pointed to by ModuleSignatures.
返回
The number of modules copied into ModuleSignatures

◆ 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.

参数
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
返回
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).

返回
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.

◆ InitStackWalkingForProcess()

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

Like InitStackWalking but initializes stack walking for another process.

参数
ProcessProcess that is going to be queried
返回
True if successful, false otherwise.

◆ 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.

警告
: 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]

参数
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
返回
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.

警告
: The code assumes that the destination strings are big enough
参数
ProgramCounterAddress to look symbol information up for
out_SymbolInfoSymbol information associated with program counter

◆ StackWalkAndDump()

static 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.

警告
: The code assumes that HumanReadableString is large enough to contain the information.
参数
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

◆ StackWalkAndDumpEx()

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.

警告
: The code assumes that HumanReadableString is large enough to contain the information.
参数
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

◆ 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.

警告
: 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]

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

◆ 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.

警告
: The code assumes that HumanReadableString is large enough to contain the information.
参数
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.

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