LLDB  mainline
Public Member Functions | Private Attributes | List of all members
lldb_private::HTRInstructionLayer Class Reference

"Base" layer of HTR representing the dynamic instructions of the trace. More...

#include <TraceHTR.h>

Inheritance diagram for lldb_private::HTRInstructionLayer:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::HTRInstructionLayer:
Collaboration graph
[legend]

Public Member Functions

 HTRInstructionLayer (size_t id)
 Construct new instruction layer. More...
 
size_t GetNumUnits () const override
 Get the total number of units (instruction or block) in this layer. More...
 
HTRBlockMetadata GetMetadataByIndex (size_t index) const override
 Get the metadata of a unit (instruction or block) in the layer. More...
 
llvm::ArrayRef< lldb::addr_tGetInstructionTrace () const
 Get the dynamic instruction trace. More...
 
void AddCallInstructionMetadata (lldb::addr_t load_addr, llvm::Optional< ConstString > func_name)
 Add metadata for a 'call' instruction of the trace. More...
 
void AppendInstruction (lldb::addr_t load_addr)
 Append the load address of an instruction to the dynamic instruction trace. More...
 
- Public Member Functions inherited from lldb_private::IHTRLayer
 IHTRLayer (size_t id)
 Construct new HTR layer. More...
 
size_t GetLayerId () const
 Get the ID of the layer. More...
 
HTRBlock MergeUnits (size_t start_unit_index, size_t num_units)
 Creates a new block from the result of merging a contiguous sequence of "units" (instructions or blocks depending on layer type) in this layer This allows the implementation class to decide how to store/generate this metadata. More...
 
virtual ~IHTRLayer ()=default
 

Private Attributes

std::vector< lldb::addr_tm_instruction_trace
 
std::unordered_map< lldb::addr_t, llvm::Optional< ConstString > > m_call_isns
 

Additional Inherited Members

- Protected Attributes inherited from lldb_private::IHTRLayer
size_t m_layer_id
 ID of the layer. More...
 

Detailed Description

"Base" layer of HTR representing the dynamic instructions of the trace.

See lldb/docs/htr.rst for comprehensive HTR documentation

Definition at line 193 of file TraceHTR.h.

Constructor & Destructor Documentation

◆ HTRInstructionLayer()

lldb_private::HTRInstructionLayer::HTRInstructionLayer ( size_t  id)
inline

Construct new instruction layer.

Parameters
[in]idThe layer's id.

Definition at line 199 of file TraceHTR.h.

Member Function Documentation

◆ AddCallInstructionMetadata()

void HTRInstructionLayer::AddCallInstructionMetadata ( lldb::addr_t  load_addr,
llvm::Optional< ConstString func_name 
)

Add metadata for a 'call' instruction of the trace.

Parameters
[in]load_addrThe load address of the 'call' instruction.
[in]func_nameThe name of the function the 'call' instruction is calling if it can be determined, None otherwise.

Definition at line 82 of file TraceHTR.cpp.

◆ AppendInstruction()

void HTRInstructionLayer::AppendInstruction ( lldb::addr_t  load_addr)

Append the load address of an instruction to the dynamic instruction trace.

Parameters
[in]load_addrThe load address of the instruction.

Definition at line 87 of file TraceHTR.cpp.

◆ GetInstructionTrace()

llvm::ArrayRef< lldb::addr_t > HTRInstructionLayer::GetInstructionTrace ( ) const

Get the dynamic instruction trace.

Returns
The dynamic instruction trace.

Definition at line 78 of file TraceHTR.cpp.

◆ GetMetadataByIndex()

HTRBlockMetadata HTRInstructionLayer::GetMetadataByIndex ( size_t  index) const
overridevirtual

Get the metadata of a unit (instruction or block) in the layer.

Parameters
[in]indexThe position of the unit in the layer.
Returns
The metadata of the unit in the layer.

Implements lldb_private::IHTRLayer.

Definition at line 105 of file TraceHTR.cpp.

Referenced by lldb_private::toJSON().

◆ GetNumUnits()

size_t HTRInstructionLayer::GetNumUnits ( ) const
overridevirtual

Get the total number of units (instruction or block) in this layer.

Returns
The total number of units in the layer.

Implements lldb_private::IHTRLayer.

Definition at line 118 of file TraceHTR.cpp.

Member Data Documentation

◆ m_call_isns

std::unordered_map<lldb::addr_t, llvm::Optional<ConstString> > lldb_private::HTRInstructionLayer::m_call_isns
private

Definition at line 239 of file TraceHTR.h.

◆ m_instruction_trace

std::vector<lldb::addr_t> lldb_private::HTRInstructionLayer::m_instruction_trace
private

Definition at line 231 of file TraceHTR.h.


The documentation for this class was generated from the following files: