// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved. using System; using System.IO; namespace MemoryProfiler2 { /// Information about an address in a callstack. public class FCallStackAddress { /// Program counter. public ulong ProgramCounter; /// Index of filename in name array. public Int32 FilenameIndex; /// Index of function in name array. public Int32 FunctionIndex; /// Line number. public Int32 LineNumber; /// True if all data is loaded for this address, e.g. filename and line number. public bool bIsComplete; /// Constructor, initializing indices to a passed in name index and other values to 0. /// Name index to propagate to all indices. public FCallStackAddress(int NameIndex) { ProgramCounter = 0; FilenameIndex = NameIndex; FunctionIndex = NameIndex; LineNumber = 0; } /// Serializing constructor. /// Stream to serialize data from /// Whether symbol info is being serialized public FCallStackAddress(BinaryReader BinaryStream,bool bShouldSerializeSymbolInfo) { ProgramCounter = BinaryStream.ReadUInt64(); // Platforms not supporting run-time symbol lookup won't serialize the below if( bShouldSerializeSymbolInfo ) { FilenameIndex = BinaryStream.ReadInt32(); FunctionIndex = BinaryStream.ReadInt32(); LineNumber = BinaryStream.ReadInt32(); } } } }