Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
WindowsPlatformStackWalk.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6#include "Microsoft/MicrosoftPlatformStackWalk.h"
7
8/**
9 * Windows implementation of the stack walking.
10 **/
13{
14 static bool InitStackWalking();
15 static bool InitStackWalkingForProcess(const FProcHandle& Process);
16
18
19 static void ProgramCounterToSymbolInfo( uint64 ProgramCounter, FProgramCounterSymbolInfo& out_SymbolInfo );
20 static void ProgramCounterToSymbolInfoEx( uint64 ProgramCounter, FProgramCounterSymbolInfoEx& out_SymbolInfo );
21 FORCENOINLINE static uint32 CaptureStackBackTrace( uint64* BackTrace, uint32 MaxDepth, void* Context = nullptr ); // FORCENOINLINE so it can be counted during StackTrace
22 static uint32 CaptureThreadStackBackTrace( uint64 ThreadId, uint64* BackTrace, uint32 MaxDepth, void* Context = nullptr);
23 FORCENOINLINE static void StackWalkAndDump( ANSICHAR* HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, void* Context = nullptr ); // FORCENOINLINE so it can be counted during StackTrace
24 static void StackWalkAndDump( ANSICHAR* HumanReadableString, SIZE_T HumanReadableStringSize, void* ProgramCounter, void* Context = nullptr );
25 static void ThreadStackWalkAndDump(ANSICHAR* HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, uint32 ThreadId);
26
27 static int32 GetProcessModuleCount();
28 static int32 GetProcessModuleSignatures(FStackWalkModuleInfo *ModuleSignatures, const int32 ModuleSignaturesSize);
29
31
32 /**
33 * Upload localy built symbols to network symbol storage.
34 *
35 * Use case:
36 * Game designers use game from source (without prebuild game .dll-files).
37 * In this case all game .dll-files are compiled locally.
38 * For post-mortem debug programmers need .dll and .pdb files from designers.
39 */
40 static bool UploadLocalSymbols();
41
42 /**
43 * Get downstream storage with downloaded from remote symbol storage files.
44 */
46
47 static void* MakeThreadContextWrapper(void* Context, void* ThreadHandle);
48 static void ReleaseThreadContextWrapper(void* ThreadContext);
49
50 /**
51 * Returns the source file pathname, line and column where the specified function is defined.
52 *
53 * The implementation extracts the information from the debug engine and the debug symbols and
54 * takes care of loading the debug symbols if the debug engine was configured to load symbols
55 * on demand. This function can be expensive if the debug symbols needs to be loaded.
56 *
57 * @param FunctionSymbolName The function name to lookup.
58 * @param FunctionModuleName The module name containing the function to lookup.
59 * @param OutPathname The source file pathname.
60 * @param OutLineNumber The line at which the function is defined in the source file.
61 * @param OutColumnNumber The offset on the line at which the function is defined in the source file.
62 * @return True if the the function location is found, false otherwise.
63 */
64 static bool GetFunctionDefinitionLocation(const FString& FunctionSymbolName, const FString& FunctionModuleName, FString& OutPathname, uint32& OutLineNumber, uint32& OutColumnNumber);
65
66private:
67 static bool InitStackWalkingInternal(void* Process, bool bForceReinitOnProcessMismatch);
68};
69
70
#define FORCENOINLINE
Definition Platform.h:647
FWindowsPlatformStackWalk FPlatformStackWalk
static TArray< FProgramCounterSymbolInfo > GetStack(int32 IgnoreCount, int32 MaxDepth=100, void *Context=nullptr)
static int32 GetProcessModuleCount()
static void ProgramCounterToSymbolInfo(uint64 ProgramCounter, FProgramCounterSymbolInfo &out_SymbolInfo)
static bool UploadLocalSymbols()
static FORCENOINLINE void StackWalkAndDump(ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, void *Context=nullptr)
static bool GetFunctionDefinitionLocation(const FString &FunctionSymbolName, const FString &FunctionModuleName, FString &OutPathname, uint32 &OutLineNumber, uint32 &OutColumnNumber)
static void StackWalkAndDump(ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, void *ProgramCounter, void *Context=nullptr)
static uint32 CaptureThreadStackBackTrace(uint64 ThreadId, uint64 *BackTrace, uint32 MaxDepth, void *Context=nullptr)
static int32 GetProcessModuleSignatures(FStackWalkModuleInfo *ModuleSignatures, const int32 ModuleSignaturesSize)
static bool InitStackWalking()
static bool InitStackWalkingInternal(void *Process, bool bForceReinitOnProcessMismatch)
static void ProgramCounterToSymbolInfoEx(uint64 ProgramCounter, FProgramCounterSymbolInfoEx &out_SymbolInfo)
static void ThreadStackWalkAndDump(ANSICHAR *HumanReadableString, SIZE_T HumanReadableStringSize, int32 IgnoreCount, uint32 ThreadId)
static void RegisterOnModulesChanged()
static bool InitStackWalkingForProcess(const FProcHandle &Process)
static void ReleaseThreadContextWrapper(void *ThreadContext)
static void * MakeThreadContextWrapper(void *Context, void *ThreadHandle)
static FString GetDownstreamStorage()