Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
GenericPlatformSymbolication.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/Set.h"
7#include "Containers/UnrealString.h"
8#include "CoreTypes.h"
9#include "GenericPlatform/GenericPlatformStackWalk.h"
10#include "Serialization/Archive.h"
11#include "Templates/UnrealTypeTraits.h"
12
13struct FProgramCounterSymbolInfo;
14template< typename InElementType, typename KeyFuncs , typename Allocator > class TSet;
15template <typename T> struct TCallTraits;
16
17/**
18 * File & line info for a debug symbol region
19 */
21{
22 uint32 Line;
23 uint64 Start;
24 uint64 Length;
25 int32 PathIdx;
26
27 /**
28 * Serializes a symbol info from or into an archive.
29 *
30 * @param Ar The archive to serialize from or into.
31 * @param Info The info to serialize.
32 */
33 friend FArchive& operator<<( FArchive& Ar, FGenericPlatformSymbolInfo& Info )
34 {
35 return Ar << Info.Line << Info.Start << Info.Length << Info.PathIdx;
36 }
37};
38
39
40/**
41 * Debug symbol information
42 */
44{
45 uint64 Start;
46 uint64 Length;
47 int32 NameIdx;
49
50 /**
51 * Serializes a symbol from or into an archive.
52 *
53 * @param Ar The archive to serialize from or into.
54 * @param Info The info to serialize.
55 */
56 friend FArchive& operator<<( FArchive& Ar, FGenericPlatformSymbolData& Info )
57 {
58 return Ar << Info.Start << Info.Length << Info.NameIdx << Info.SymbolInfo;
59 }
60};
61
62
63/**
64 * Container for debug symbols corresponding to a single binary file
65 */
67{
72
73 /**
74 * Serializes a symbol container from or into an archive.
75 *
76 * @param Ar The archive to serialize from or into.
77 * @param Info The info to serialize.
78 */
79 friend FArchive& operator<<( FArchive& Ar, FGenericPlatformSymbolDatabase& Info )
80 {
81 return Ar << Info.Signature << Info.Name << Info.Symbols << Info.StringTable;
82 }
83};
84
85
87{
88 enum { bAllowDuplicateKeys = 0 };
91
92 /**
93 * @return The key used to index the given element.
94 */
96 {
97 return Element.Signature;
98 }
99
100 /**
101 * @return True if the keys match.
102 */
104 {
105 return A == B;
106 }
107
108 /** Calculates a hash index for a key. */
110 {
111 return GetTypeHash(Key);
112 }
113};
114
115
117
118
120{
121 static bool LoadSymbolDatabaseForBinary(FString SourceFolder, FString BinaryPath, FString BinarySignature, FGenericPlatformSymbolDatabase& OutDatabase);
123
124 static bool SymbolInfoForStrippedSymbol(FGenericPlatformSymbolDatabase const& Database, uint64 ProgramCounter, uint64 ModuleOffset, FString ModuleSignature, FProgramCounterSymbolInfo& Info);
125
126 static bool SymbolInfoForAddress(uint64 ProgramCounter, FProgramCounterSymbolInfo& Info) { return false; }
127};
TSet< FGenericPlatformSymbolDatabase, FGenericPlatformSymbolDatabaseKeyFuncs > FGenericPlatformSymbolDatabaseSet
#define FORCEINLINE
Definition Platform.h:644
Definition Set.h:282
TArray< FGenericPlatformSymbolInfo > SymbolInfo
TArray< FGenericPlatformSymbolData > Symbols
static FORCEINLINE bool Matches(KeyInitType A, KeyInitType B)
static FORCEINLINE KeyInitType GetSetKey(ElementInitType Element)
TCallTraits< FGenericPlatformSymbolDatabase >::ParamType ElementInitType
TCallTraits< FString >::ParamType KeyInitType
static FORCEINLINE uint32 GetKeyHash(KeyInitType Key)
static bool SymbolInfoForAddress(uint64 ProgramCounter, FProgramCounterSymbolInfo &Info)
static bool LoadSymbolDatabaseForBinary(FString SourceFolder, FString BinaryPath, FString BinarySignature, FGenericPlatformSymbolDatabase &OutDatabase)
static bool SymbolInfoForStrippedSymbol(FGenericPlatformSymbolDatabase const &Database, uint64 ProgramCounter, uint64 ModuleOffset, FString ModuleSignature, FProgramCounterSymbolInfo &Info)
static bool SaveSymbolDatabaseForBinary(FString TargetFolder, FString Name, FGenericPlatformSymbolDatabase &Database)