UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
CallstackTrace.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2#pragma once
3#include "HAL/Platform.h"
4#include "HAL/PlatformTLS.h"
6#include "Misc/Build.h"
7#include "Trace/Config.h"
9
11#if !defined(UE_CALLSTACK_TRACE_ENABLED)
12 #if UE_TRACE_ENABLED && !UE_BUILD_SHIPPING
13 #if PLATFORM_WINDOWS && !PLATFORM_CPU_ARM_FAMILY
14 #define UE_CALLSTACK_TRACE_ENABLED 1
15 #endif
16 #endif
17#endif
18
19#if !defined(UE_CALLSTACK_TRACE_ENABLED)
20 #define UE_CALLSTACK_TRACE_ENABLED 0
21#endif
22
23#if !defined(UE_CALLSTACK_TRACE_MAX_FRAMES)
24 #define UE_CALLSTACK_TRACE_MAX_FRAMES 255
25#endif
26
28#if UE_CALLSTACK_TRACE_ENABLED
29
34void CallstackTrace_Create(class FMalloc* Malloc);
35
40
49
56
63#define CALLSTACK_TRACE_LIMIT_CALLSTACKRESOLVE_SCOPE() FCallStackTraceLimitResolveScope PREPROCESSOR_JOIN(FCTLMScope,__LINE__)
64
66
71{
74 else
75 return nullptr;
76}
77
82{
84}
85
86/*
87 * Callstack Trace scope for override CallStack
88 */
90{
91public:
93 {
95 {
97 }
98 }
99
101 {
103 {
105 }
106 }
107};
108
109#else // UE_CALLSTACK_TRACE_ENABLED
110
111inline void CallstackTrace_Create(class FMalloc* Malloc) {}
114inline void* CallstackTrace_GetCurrentReturnAddressData() { return nullptr; }
116inline bool CallstackTrace_ResolveFullCallStack() { return true; }
117
118#define CALLSTACK_TRACE_LIMIT_CALLSTACKRESOLVE_SCOPE()
119
120#endif // UE_CALLSTACK_TRACE_ENABLED
#define PLATFORM_RETURN_ADDRESS_FOR_CALLSTACKTRACING
Definition AndroidPlatform.h:68
#define FORCENOINLINE
Definition AndroidPlatform.h:142
void * CallstackTrace_GetCurrentReturnAddressData()
Definition CallstackTrace.h:114
void CallstackTrace_Initialize()
Definition CallstackTrace.h:112
uint32 CallstackTrace_GetCurrentId()
Definition CallstackTrace.h:113
void CallstackTrace_Create(class FMalloc *Malloc)
Definition CallstackTrace.h:111
void * CallstackTrace_GetFallbackPlatformReturnAddressData()
Definition CallstackTrace.h:115
bool CallstackTrace_ResolveFullCallStack()
Definition CallstackTrace.h:116
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 MemoryBase.h:99
static UE_FORCEINLINE_HINT void * GetTlsValue(uint32 SlotIndex)
Definition AndroidPlatformTLS.h:57
static UE_FORCEINLINE_HINT void SetTlsValue(uint32 SlotIndex, void *Value)
Definition AndroidPlatformTLS.h:47
static UE_FORCEINLINE_HINT bool IsValidTlsSlot(uint32 SlotIndex)
Definition GenericPlatformTLS.h:20