UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UnixPlatformCrashContext.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"
7#include "CoreTypes.h"
9#include "Unix/UnixSystemIncludes.h" // IWYU pragma: export
10#include "Templates/Atomic.h"
11
12#include <ucontext.h> // IWYU pragma: export
13
16{
17 // If we want a backtrace or a callstack
18 // Backtrace is just a list of program counters and callstack is a symbolicated backtrace
20 union
21 {
24 };
25
29};
30
32{
35
38
41
44
47
50
53
56
59
62 void* ErrorFrame = nullptr;
63
75
77
86
92 CORE_API void InitFromDiagnostics(const void* InAddress = nullptr);
93
98 CORE_API void CaptureStackTrace(void* ErrorProgramCounter);
99
106
113
118
123
124 CORE_API virtual void GetPortableCallStack(const uint64* StackFrames, int32 NumStackFrames, TArray<FCrashStackFrame>& OutCallStack) const override;
125
127
128protected:
134 CORE_API void GenerateReport(const FString & DiagnosticsPath) const;
135};
136
138
140{
144 void PreInit();
145
152}
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
ECrashContextType
Definition GenericPlatformCrashContext.h:112
FUnixCrashContext FPlatformCrashContext
Definition UnixPlatformCrashContext.h:137
Definition Array.h:670
Definition Atomic.h:538
Definition UnixPlatformCrashContext.cpp:375
void PreInit()
Definition UnixPlatformCrashContext.cpp:438
void RemoveValidCrashReportTickerForChildProcess()
Definition UnixPlatformCrashContext.cpp:490
@ false
Definition radaudio_common.h:23
Definition GenericPlatformCrashContext.h:395
ECrashContextType Type
Definition GenericPlatformCrashContext.h:792
Definition UnixPlatformCrashContext.h:32
TCHAR SignalDescription[256]
Definition UnixPlatformCrashContext.h:49
FUnixCrashContext(ECrashContextType InType, const TCHAR *InErrorMessage)
Definition UnixPlatformCrashContext.h:64
CORE_API void AddPlatformSpecificProperties() const
Definition UnixPlatformCrashContext.cpp:502
CORE_API void InitFromDiagnostics(const void *InAddress=nullptr)
Definition UnixPlatformCrashContext.cpp:119
CORE_API void GenerateCrashInfoAndLaunchReporter() const
Definition UnixPlatformCrashContext.cpp:520
void * ErrorFrame
Definition UnixPlatformCrashContext.h:62
CORE_API ~FUnixCrashContext()
Definition UnixPlatformCrashContext.cpp:100
virtual CORE_API void GetPortableCallStack(const uint64 *StackFrames, int32 NumStackFrames, TArray< FCrashStackFrame > &OutCallStack) const override
Definition UnixPlatformCrashContext.cpp:336
char MinidumpCallstackInfo[16384]
Definition UnixPlatformCrashContext.h:52
CORE_API void CaptureStackTrace(void *ErrorProgramCounter)
Definition UnixPlatformCrashContext.cpp:284
bool bCapturedBacktrace
Definition UnixPlatformCrashContext.h:43
CORE_API void CaptureThreadStackTrace(uint32_t ThreadId)
Definition UnixPlatformCrashContext.cpp:309
CORE_API void GenerateReport(const FString &DiagnosticsPath) const
Definition UnixPlatformCrashContext.cpp:227
uint64 * FirstCrashHandlerFrame
Definition UnixPlatformCrashContext.h:58
siginfo_t * Info
Definition UnixPlatformCrashContext.h:37
CORE_API void InitFromSignal(int32 InSignal, siginfo_t *InInfo, void *InContext)
Definition UnixPlatformCrashContext.cpp:110
CORE_API void SetFirstCrashHandlerFrame(uint64 *ProgramCounter)
int32 Signal
Definition UnixPlatformCrashContext.h:34
char ** BacktraceSymbols
Definition UnixPlatformCrashContext.h:46
void SetType(ECrashContextType InType)
Definition UnixPlatformCrashContext.h:117
static CORE_API __thread siginfo_t FakeSiginfoForDiagnostics
Definition UnixPlatformCrashContext.h:55
ucontext_t * Context
Definition UnixPlatformCrashContext.h:40
Definition UnixPlatformCrashContext.h:16
int32 BackTraceCount
Definition UnixPlatformCrashContext.h:26
SIZE_T CallStackSize
Definition UnixPlatformCrashContext.h:27
ANSICHAR * CallStack
Definition UnixPlatformCrashContext.h:22
uint64 * BackTrace
Definition UnixPlatformCrashContext.h:23
TAtomic< bool > bDone
Definition UnixPlatformCrashContext.h:28
bool bCaptureCallStack
Definition UnixPlatformCrashContext.h:19