UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
GenericPlatformStackWalk.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
6#include "Containers/Map.h"
8#include "CoreTypes.h"
9#include "UObject/NameTypes.h"
10
11class FName;
13struct FProcHandle;
15
21{
30 struct
31 {
32 unsigned long Data1;
33 unsigned short Data2;
34 unsigned short Data3;
35 unsigned char Data4[8];
37};
38
74
101
106{
108
110 {
111 enum
112 {
115
117 FastStackWalk = (1 << 0),
118
121 };
122 };
123
127 static CORE_API void Init();
128
132 static bool InitStackWalking()
133 {
134 return 1;
135 }
136
143 {
144 return false;
145 }
146
167
187
190
199 {
200 out_SymbolInfo.ProgramCounter = ProgramCounter;
201 }
202
205 {
206 out_SymbolInfo.ProgramCounter = ProgramCounter;
207 }
208
216 static CORE_API uint32 CaptureStackBackTrace( uint64* BackTrace, uint32 MaxDepth, void* Context = nullptr );
217
226 static CORE_API uint32 CaptureThreadStackBackTrace(uint64 ThreadId, uint64* BackTrace, uint32 MaxDepth, void* Context = nullptr);
227
237 CORE_API FORCENOINLINE static void StackWalkAndDump( ANSICHAR* HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, void* Context = nullptr ); // FORCENOINLINE so it can be counted during StackTrace
238
248 static CORE_API void StackWalkAndDump( ANSICHAR* HumanReadableString, SIZE_T HumanReadableStringSize, void* ProgramCounter, void* Context = nullptr );
249
259 static CORE_API TArray<FProgramCounterSymbolInfo> GetStack(int32 IgnoreCount, int32 MaxDepth = 100, void* Context = nullptr);
260
273
295 static CORE_API void StackWalkAndDumpEx( ANSICHAR* HumanReadableString, SIZE_T HumanReadableStringSize, void* ProgramCounter, uint32 Flags, void* Context = nullptr );
296
301 {
302 return 0;
303 }
304
313 FORCEINLINE static int32 GetProcessModuleSignatures(FStackWalkModuleInfo *ModuleSignatures, const int32 ModuleSignaturesSize)
314 {
315 return 0;
316 }
317
325
327 static CORE_API void CopyVirtualPathToLocal(char* Dest, int32 DestCapacity, const char* Source);
328
329protected:
330
333
334};
#define FORCENOINLINE
Definition AndroidPlatform.h:142
#define FORCEINLINE
Definition AndroidPlatform.h:140
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::ANSICHAR ANSICHAR
An ANSI character. Normally a signed type.
Definition Platform.h:1131
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition NameTypes.h:617
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition GenericPlatformCrashContext.h:395
Definition GenericPlatformStackWalk.h:110
@ AccurateStackWalk
Definition GenericPlatformStackWalk.h:114
@ FastStackWalk
Definition GenericPlatformStackWalk.h:117
@ FlagsUsedWhenHandlingEnsure
Definition GenericPlatformStackWalk.h:120
Definition GenericPlatformStackWalk.h:106
static CORE_API void StackWalkAndDumpEx(ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, uint32 Flags, void *Context=nullptr)
Definition GenericPlatformStackWalk.cpp:231
static CORE_API bool WantsDetailedCallstacksInNonMonolithicBuilds()
Definition GenericPlatformStackWalk.cpp:42
FGenericPlatformStackWalk Base
Definition GenericPlatformStackWalk.h:107
static bool InitStackWalkingForProcess(const FProcHandle &Process)
Definition GenericPlatformStackWalk.h:142
static CORE_API TArray< FProgramCounterSymbolInfo > GetStack(int32 IgnoreCount, int32 MaxDepth=100, void *Context=nullptr)
Definition GenericPlatformStackWalk.cpp:242
static CORE_API uint32 CaptureThreadStackBackTrace(uint64 ThreadId, uint64 *BackTrace, uint32 MaxDepth, void *Context=nullptr)
Definition GenericPlatformStackWalk.cpp:173
static void ThreadStackWalkAndDump(ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, uint32 ThreadId)
Definition GenericPlatformStackWalk.h:270
static void ProgramCounterToSymbolInfo(uint64 ProgramCounter, FProgramCounterSymbolInfo &out_SymbolInfo)
Definition GenericPlatformStackWalk.h:198
static CORE_API void Init()
Definition GenericPlatformStackWalk.cpp:34
static FORCEINLINE int32 GetProcessModuleCount()
Definition GenericPlatformStackWalk.h:300
static void ProgramCounterToSymbolInfoEx(uint64 ProgramCounter, FProgramCounterSymbolInfoEx &out_SymbolInfo)
Definition GenericPlatformStackWalk.h:204
static CORE_API bool ProgramCounterToHumanReadableString(int32 CurrentCallDepth, uint64 ProgramCounter, ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, FGenericCrashContext *Context=nullptr)
Definition GenericPlatformStackWalk.cpp:47
static FORCEINLINE int32 GetProcessModuleSignatures(FStackWalkModuleInfo *ModuleSignatures, const int32 ModuleSignaturesSize)
Definition GenericPlatformStackWalk.h:313
static CORE_API bool SymbolInfoToHumanReadableString(const FProgramCounterSymbolInfo &SymbolInfo, ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize)
Definition GenericPlatformStackWalk.cpp:59
static bool InitStackWalking()
Definition GenericPlatformStackWalk.h:132
static CORE_API uint32 CaptureStackBackTrace(uint64 *BackTrace, uint32 MaxDepth, void *Context=nullptr)
Definition GenericPlatformStackWalk.cpp:168
static CORE_API bool SymbolInfoToHumanReadableStringEx(const FProgramCounterSymbolInfoEx &SymbolInfo, FString &out_HumanReadableString)
Definition GenericPlatformStackWalk.cpp:132
static CORE_API TMap< FName, FString > GetSymbolMetaData()
Definition GenericPlatformStackWalk.cpp:274
static CORE_API void CopyVirtualPathToLocal(char *Dest, int32 DestCapacity, const char *Source)
Definition GenericPlatformStackWalk.cpp:279
CORE_API static FORCENOINLINE void StackWalkAndDump(ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, void *Context=nullptr)
Definition GenericPlatformStackWalk.cpp:178
Definition AndroidPlatformProcess.h:13
Definition GenericPlatformStackWalk.h:76
uint64 OffsetInModule
Definition GenericPlatformStackWalk.h:93
uint32 LineNumber
Definition GenericPlatformStackWalk.h:87
FString ModuleName
Definition GenericPlatformStackWalk.h:78
uint64 ProgramCounter
Definition GenericPlatformStackWalk.h:96
uint64 SymbolDisplacement
Definition GenericPlatformStackWalk.h:90
FString Filename
Definition GenericPlatformStackWalk.h:84
FString FunctionName
Definition GenericPlatformStackWalk.h:81
Definition GenericPlatformStackWalk.h:43
ANSICHAR Filename[MAX_NAME_LENGTH]
Definition GenericPlatformStackWalk.h:57
uint64 OffsetInModule
Definition GenericPlatformStackWalk.h:66
ANSICHAR ModuleName[MAX_NAME_LENGTH]
Definition GenericPlatformStackWalk.h:51
ANSICHAR FunctionName[MAX_NAME_LENGTH]
Definition GenericPlatformStackWalk.h:54
int32 LineNumber
Definition GenericPlatformStackWalk.h:60
@ MAX_NAME_LENGTH
Definition GenericPlatformStackWalk.h:47
int32 SymbolDisplacement
Definition GenericPlatformStackWalk.h:63
CORE_API FProgramCounterSymbolInfo()
Definition GenericPlatformStackWalk.cpp:9
uint64 ProgramCounter
Definition GenericPlatformStackWalk.h:69
Definition GenericPlatformStackWalk.h:21
uint32 ImageSize
Definition GenericPlatformStackWalk.h:23
uint32 PdbSig
Definition GenericPlatformStackWalk.h:28
uint32 PdbAge
Definition GenericPlatformStackWalk.h:29
struct FStackWalkModuleInfo::@199 PdbSig70
uint64 BaseOfImage
Definition GenericPlatformStackWalk.h:22
unsigned long Data1
Definition GenericPlatformStackWalk.h:32
TCHAR ImageName[256]
Definition GenericPlatformStackWalk.h:26
unsigned short Data2
Definition GenericPlatformStackWalk.h:33
TCHAR LoadedImageName[256]
Definition GenericPlatformStackWalk.h:27
unsigned char Data4[8]
Definition GenericPlatformStackWalk.h:35
unsigned short Data3
Definition GenericPlatformStackWalk.h:34
uint32 TimeDateStamp
Definition GenericPlatformStackWalk.h:24
TCHAR ModuleName[32]
Definition GenericPlatformStackWalk.h:25