UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AndroidPlatformCrashContext.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
6#include "Containers/Map.h"
7
9{
12
15
18
20 void* Context;
21
23
27
42
43 CORE_API virtual void GetPortableCallStack(const uint64* StackFrames, int32 NumStackFrames, TArray<FCrashStackFrame>& OutCallStack) const override;
44 CORE_API virtual void AddPlatformSpecificProperties() const override;
45
47 CORE_API void StoreCrashInfo(bool bWriteLog) const;
48
49 static const int32 CrashReportMaxPathSize = 512;
50
51 static CORE_API void Initialize();
52 // Returns the report directory used for this crash context.
53 FString GetCurrentReportDirectoryPath() const { return FString(ReportDirectory); }
54
55 // Returns the main crash directory for this session. This will not be correct for non-fatal reports.
56 static CORE_API const FString GetGlobalCrashDirectoryPath();
57 // Fills DirectoryNameOUT with the global crash directory for a fatal crash this session. This will not be correct for non-fatal reports.
59
60 CORE_API void AddAndroidCrashProperty(const FString& Key, const FString& Value);
61
63
64 // generate an absolute path to a crash report folder.
66
67 // expects externally allocated memory for all threads found in FThreadManager + main thread
68 CORE_API void DumpAllThreadCallstacks(FAsyncThreadBackTrace* BackTrace, int NumThreads) const;
69
71 static CORE_API const ANSICHAR* ItoANSI(uint64 Val, uint64 Base, uint32 Len = 0);
72
73 // temporary accessor to allow overriding of the portable callstack.
75
76protected:
77
79 CORE_API virtual const TCHAR* GetCallstackProperty() const;
80
81private:
82 FString OverrideCallstack;
83
84 TMap<FString, FString> AdditionalProperties;
85
86 // The path used by this instance to store the report.
87 char ReportDirectory[CrashReportMaxPathSize];
88};
89
97
FAndroidCrashContext FPlatformCrashContext
Definition AndroidPlatformCrashContext.h:98
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
ECrashContextType
Definition GenericPlatformCrashContext.h:112
float Val(const FString &Value)
Definition UnrealMath.cpp:3163
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition AndroidPlatformCrashContext.h:9
siginfo * Info
Definition AndroidPlatformCrashContext.h:17
virtual CORE_API const TCHAR * GetCallstackProperty() const
Definition AndroidPlatformCrashContext.cpp:412
static CORE_API const FString GetGlobalCrashDirectoryPath()
Definition AndroidPlatformCrashContext.cpp:137
CORE_API void StoreCrashInfo(bool bWriteLog) const
Definition AndroidPlatformCrashContext.cpp:208
CORE_API void CaptureCrashInfo()
Definition AndroidPlatformCrashContext.cpp:417
uint32 CrashingThreadId
Definition AndroidPlatformCrashContext.h:14
virtual CORE_API void AddPlatformSpecificProperties() const override
Definition AndroidPlatformCrashContext.cpp:477
int32 Signal
Definition AndroidPlatformCrashContext.h:11
CORE_API void AddAndroidCrashProperty(const FString &Key, const FString &Value)
Definition AndroidPlatformCrashContext.cpp:472
virtual CORE_API void GetPortableCallStack(const uint64 *StackFrames, int32 NumStackFrames, TArray< FCrashStackFrame > &OutCallStack) const override
Definition AndroidPlatformCrashContext.cpp:485
CORE_API void DumpAllThreadCallstacks(FAsyncThreadBackTrace *BackTrace, int NumThreads) const
Definition AndroidPlatformCrashContext.cpp:230
static CORE_API void GenerateReportDirectoryName(char(&DirectoryNameOUT)[CrashReportMaxPathSize])
Definition AndroidPlatformCrashContext.cpp:177
static CORE_API const ANSICHAR * ItoANSI(uint64 Val, uint64 Base, uint32 Len=0)
Definition AndroidPlatformCrashContext.cpp:147
CORE_API void SetOverrideCallstack(const FString &OverrideCallstackIN)
Definition AndroidPlatformCrashContext.cpp:398
TArray< FCrashStackFrame > & GetPortableCallstack_TEMP()
Definition AndroidPlatformCrashContext.h:74
FString GetCurrentReportDirectoryPath() const
Definition AndroidPlatformCrashContext.h:53
~FAndroidCrashContext()
Definition AndroidPlatformCrashContext.h:24
static CORE_API void Initialize()
Definition AndroidPlatformCrashContext.cpp:373
void InitFromSignal(int32 InSignal, siginfo *InInfo, void *InContext, uint32 InCrashingThreadId)
Definition AndroidPlatformCrashContext.h:35
static const int32 CrashReportMaxPathSize
Definition AndroidPlatformCrashContext.h:49
void * Context
Definition AndroidPlatformCrashContext.h:20
Definition AndroidPlatformCrashContext.h:91
FAndroidPlatformMemory::ETrimValues LastTrimMemoryState
Definition AndroidPlatformCrashContext.h:95
FAndroidMemoryWarningContext()
Definition AndroidPlatformCrashContext.h:92
Definition AndroidPlatformMemory.h:26
ETrimValues
Definition AndroidPlatformMemory.h:91
Definition AndroidPlatformStackWalk.h:12
Definition GenericPlatformCrashContext.h:395
TArray< FCrashStackFrame > CallStack
Definition GenericPlatformCrashContext.h:796
Definition GenericPlatformCrashContext.h:899