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

#include <DecodedThread.h>

Collaboration diagram for lldb_private::trace_intel_pt::IntelPTInstruction:
Collaboration graph
[legend]

Public Member Functions

 IntelPTInstruction (const pt_insn &pt_insn, uint64_t timestamp)
 
 IntelPTInstruction (const pt_insn &pt_insn)
 
 IntelPTInstruction (llvm::Error err)
 Error constructor. More...
 
bool IsError () const
 Check if this object represents an error (i.e. More...
 
lldb::addr_t GetLoadAddress () const
 
llvm::Error ToError () const
 
llvm::Optional< uint64_t > GetTimestampCounter () const
 Get the timestamp associated with the current instruction. More...
 
lldb::TraceInstructionControlFlowType GetControlFlowType (lldb::addr_t next_load_address) const
 Get the lldb::TraceInstructionControlFlowType categories of the instruction. More...
 
 IntelPTInstruction (IntelPTInstruction &&other)=default
 

Private Member Functions

 IntelPTInstruction (const IntelPTInstruction &other)=delete
 
const IntelPTInstructionoperator= (const IntelPTInstruction &other)=delete
 

Private Attributes

pt_insn m_pt_insn
 
llvm::Optional< uint64_t > m_timestamp
 
std::unique_ptr< llvm::ErrorInfoBase > m_error
 

Detailed Description

An instruction obtained from decoding a trace. It is either an actual instruction or an error indicating a gap in the trace.

Gaps in the trace can come in a few flavors:

Definition at line 62 of file DecodedThread.h.

Constructor & Destructor Documentation

◆ IntelPTInstruction() [1/5]

lldb_private::trace_intel_pt::IntelPTInstruction::IntelPTInstruction ( const pt_insn &  pt_insn,
uint64_t  timestamp 
)
inline

Definition at line 64 of file DecodedThread.h.

◆ IntelPTInstruction() [2/5]

lldb_private::trace_intel_pt::IntelPTInstruction::IntelPTInstruction ( const pt_insn &  pt_insn)
inline

Definition at line 67 of file DecodedThread.h.

◆ IntelPTInstruction() [3/5]

IntelPTInstruction::IntelPTInstruction ( llvm::Error  err)

Error constructor.

libipt errors should use the underlying IntelPTError class.

Definition at line 38 of file DecodedThread.cpp.

References LLDB_INVALID_ADDRESS, m_error, and m_pt_insn.

◆ IntelPTInstruction() [4/5]

lldb_private::trace_intel_pt::IntelPTInstruction::IntelPTInstruction ( IntelPTInstruction &&  other)
default

◆ IntelPTInstruction() [5/5]

lldb_private::trace_intel_pt::IntelPTInstruction::IntelPTInstruction ( const IntelPTInstruction other)
privatedelete

Member Function Documentation

◆ GetControlFlowType()

TraceInstructionControlFlowType IntelPTInstruction::GetControlFlowType ( lldb::addr_t  next_load_address) const

Get the lldb::TraceInstructionControlFlowType categories of the instruction.

Parameters
[in]next_load_addressThe address of the next instruction in the trace or LLDB_INVALID_ADDRESS if not available.
Returns
The control flow categories, or 0 if the instruction is an error.

Definition at line 67 of file DecodedThread.cpp.

References IsError(), and m_pt_insn.

◆ GetLoadAddress()

lldb::addr_t IntelPTInstruction::GetLoadAddress ( ) const
Returns
The instruction pointer address, or LLDB_INVALID_ADDRESS if it is an error.

Definition at line 49 of file DecodedThread.cpp.

References m_pt_insn.

◆ GetTimestampCounter()

Optional< uint64_t > IntelPTInstruction::GetTimestampCounter ( ) const

Get the timestamp associated with the current instruction.

The timestamp is similar to what a rdtsc instruction would return.

Returns
The timestamp or llvm::None if not available.

Definition at line 51 of file DecodedThread.cpp.

References m_timestamp.

◆ IsError()

bool IntelPTInstruction::IsError ( ) const

Check if this object represents an error (i.e.

a gap).

Returns
Whether this object represents an error.

Definition at line 47 of file DecodedThread.cpp.

References m_error.

Referenced by GetControlFlowType(), and ToError().

◆ operator=()

const IntelPTInstruction& lldb_private::trace_intel_pt::IntelPTInstruction::operator= ( const IntelPTInstruction other)
privatedelete

◆ ToError()

Error IntelPTInstruction::ToError ( ) const
Returns
An llvm::Error object if this class corresponds to an Error, or an llvm::Error::success otherwise.

Definition at line 55 of file DecodedThread.cpp.

References IsError(), and m_error.

Member Data Documentation

◆ m_error

std::unique_ptr<llvm::ErrorInfoBase> lldb_private::trace_intel_pt::IntelPTInstruction::m_error
private

Definition at line 117 of file DecodedThread.h.

Referenced by IntelPTInstruction(), IsError(), and ToError().

◆ m_pt_insn

pt_insn lldb_private::trace_intel_pt::IntelPTInstruction::m_pt_insn
private

Definition at line 115 of file DecodedThread.h.

Referenced by GetControlFlowType(), GetLoadAddress(), and IntelPTInstruction().

◆ m_timestamp

llvm::Optional<uint64_t> lldb_private::trace_intel_pt::IntelPTInstruction::m_timestamp
private

Definition at line 116 of file DecodedThread.h.

Referenced by GetTimestampCounter().


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