LLDB mainline
lldb_private::Opcode Class Reference

#include <Opcode.h>

Public Types

enum  Type {
  eTypeInvalid , eType8 , eType16 , eType16_2 ,
  eType16_32Tuples , eType32 , eType64 , eTypeBytes
}

Public Member Functions

 Opcode ()=default
 Opcode (uint8_t inst, lldb::ByteOrder order)
 Opcode (uint16_t inst, lldb::ByteOrder order)
 Opcode (uint32_t inst, lldb::ByteOrder order)
 Opcode (uint64_t inst, lldb::ByteOrder order)
 Opcode (uint8_t *bytes, size_t length, Opcode::Type type, lldb::ByteOrder order)
void Clear ()
Opcode::Type GetType () const
uint8_t GetOpcode8 (uint8_t invalid_opcode=UINT8_MAX) const
uint16_t GetOpcode16 (uint16_t invalid_opcode=UINT16_MAX) const
uint32_t GetOpcode32 (uint32_t invalid_opcode=UINT32_MAX) const
uint64_t GetOpcode64 (uint64_t invalid_opcode=UINT64_MAX) const
void SetOpcode8 (uint8_t inst, lldb::ByteOrder order)
void SetOpcode16 (uint16_t inst, lldb::ByteOrder order)
void SetOpcode16_2 (uint32_t inst, lldb::ByteOrder order)
void SetOpcode32 (uint32_t inst, lldb::ByteOrder order)
void SetOpcode64 (uint64_t inst, lldb::ByteOrder order)
void SetOpcode16_32TupleBytes (const void *bytes, size_t length, lldb::ByteOrder order)
void SetOpcodeBytes (const void *bytes, size_t length)
void DoSetOpcodeBytes (const void *bytes, size_t length, Opcode::Type type, lldb::ByteOrder order)
int Dump (Stream *s, uint32_t min_byte_width) const
const void * GetOpcodeBytes () const
uint32_t GetByteSize () const
uint32_t GetData (DataExtractor &data) const

Static Public Attributes

static constexpr size_t kMaxByteSize = 16
 The size in bytes of the fixed buffer used to store opcode bytes.

Protected Member Functions

const void * GetOpcodeDataBytes () const
lldb::ByteOrder GetDataByteOrder () const
bool GetEndianSwap () const

Protected Attributes

lldb::ByteOrder m_byte_order = lldb::eByteOrderInvalid
Opcode::Type m_type = eTypeInvalid
union { 
   uint8_t   inst8 
   uint16_t   inst16 
   uint32_t   inst32 
   uint64_t   inst64 
   struct { 
      uint8_t   bytes [kMaxByteSize
      uint8_t   length 
   }   inst
m_data

Friends

class lldb::SBInstruction

Detailed Description

Definition at line 29 of file Opcode.h.

Member Enumeration Documentation

◆ Type

Enumerator
eTypeInvalid 
eType8 
eType16 
eType16_2 
eType16_32Tuples 
eType32 
eType64 
eTypeBytes 

Definition at line 31 of file Opcode.h.

Constructor & Destructor Documentation

◆ Opcode() [1/6]

lldb_private::Opcode::Opcode ( )
default

◆ Opcode() [2/6]

lldb_private::Opcode::Opcode ( uint8_t inst,
lldb::ByteOrder order )
inline

Definition at line 51 of file Opcode.h.

References eType8, inst, m_byte_order, m_data, and m_type.

◆ Opcode() [3/6]

lldb_private::Opcode::Opcode ( uint16_t inst,
lldb::ByteOrder order )
inline

Definition at line 56 of file Opcode.h.

References eType16, inst, m_byte_order, m_data, and m_type.

◆ Opcode() [4/6]

lldb_private::Opcode::Opcode ( uint32_t inst,
lldb::ByteOrder order )
inline

Definition at line 61 of file Opcode.h.

References eType32, inst, m_byte_order, m_data, and m_type.

◆ Opcode() [5/6]

lldb_private::Opcode::Opcode ( uint64_t inst,
lldb::ByteOrder order )
inline

Definition at line 66 of file Opcode.h.

References eType64, inst, m_byte_order, m_data, and m_type.

◆ Opcode() [6/6]

lldb_private::Opcode::Opcode ( uint8_t * bytes,
size_t length,
Opcode::Type type,
lldb::ByteOrder order )
inline

Definition at line 71 of file Opcode.h.

References bytes, DoSetOpcodeBytes(), and length.

Member Function Documentation

◆ Clear()

void lldb_private::Opcode::Clear ( )
inline

Definition at line 76 of file Opcode.h.

References lldb::eByteOrderInvalid, eTypeInvalid, m_byte_order, and m_type.

◆ DoSetOpcodeBytes()

void lldb_private::Opcode::DoSetOpcodeBytes ( const void * bytes,
size_t length,
Opcode::Type type,
lldb::ByteOrder order )
inline

Definition at line 214 of file Opcode.h.

References bytes, eTypeInvalid, length, m_byte_order, m_data, and m_type.

Referenced by Opcode(), SetOpcode16_32TupleBytes(), and SetOpcodeBytes().

◆ Dump()

◆ GetByteSize()

◆ GetData()

◆ GetDataByteOrder()

lldb::ByteOrder Opcode::GetDataByteOrder ( ) const
protected

◆ GetEndianSwap()

bool lldb_private::Opcode::GetEndianSwap ( ) const
inlineprotected

◆ GetOpcode16()

uint16_t lldb_private::Opcode::GetOpcode16 ( uint16_t invalid_opcode = UINT16_MAX) const
inline

◆ GetOpcode32()

uint32_t lldb_private::Opcode::GetOpcode32 ( uint32_t invalid_opcode = UINT32_MAX) const
inline

◆ GetOpcode64()

uint64_t lldb_private::Opcode::GetOpcode64 ( uint64_t invalid_opcode = UINT64_MAX) const
inline

◆ GetOpcode8()

uint8_t lldb_private::Opcode::GetOpcode8 ( uint8_t invalid_opcode = UINT8_MAX) const
inline

Definition at line 83 of file Opcode.h.

References eType16, eType16_2, eType16_32Tuples, eType32, eType64, eType8, eTypeBytes, eTypeInvalid, m_data, and m_type.

◆ GetOpcodeBytes()

const void * lldb_private::Opcode::GetOpcodeBytes ( ) const
inline

Definition at line 230 of file Opcode.h.

References eType16_32Tuples, eTypeBytes, m_data, and m_type.

Referenced by x86::GetControlFlowKind().

◆ GetOpcodeDataBytes()

const void * lldb_private::Opcode::GetOpcodeDataBytes ( ) const
inlineprotected

Definition at line 263 of file Opcode.h.

References eType16, eType16_2, eType16_32Tuples, eType32, eType64, eType8, eTypeBytes, eTypeInvalid, m_data, and m_type.

Referenced by GetData().

◆ GetType()

Opcode::Type lldb_private::Opcode::GetType ( ) const
inline

Definition at line 81 of file Opcode.h.

References m_type.

◆ SetOpcode16()

void lldb_private::Opcode::SetOpcode16 ( uint16_t inst,
lldb::ByteOrder order )
inline

Definition at line 181 of file Opcode.h.

References eType16, inst, m_byte_order, m_data, and m_type.

◆ SetOpcode16_2()

void lldb_private::Opcode::SetOpcode16_2 ( uint32_t inst,
lldb::ByteOrder order )
inline

Definition at line 187 of file Opcode.h.

References eType16_2, inst, m_byte_order, m_data, and m_type.

◆ SetOpcode16_32TupleBytes()

void lldb_private::Opcode::SetOpcode16_32TupleBytes ( const void * bytes,
size_t length,
lldb::ByteOrder order )
inline

Definition at line 205 of file Opcode.h.

References bytes, DoSetOpcodeBytes(), eType16_32Tuples, and length.

◆ SetOpcode32()

void lldb_private::Opcode::SetOpcode32 ( uint32_t inst,
lldb::ByteOrder order )
inline

Definition at line 193 of file Opcode.h.

References eType32, inst, m_byte_order, m_data, and m_type.

◆ SetOpcode64()

void lldb_private::Opcode::SetOpcode64 ( uint64_t inst,
lldb::ByteOrder order )
inline

Definition at line 199 of file Opcode.h.

References eType64, inst, m_byte_order, m_data, and m_type.

◆ SetOpcode8()

void lldb_private::Opcode::SetOpcode8 ( uint8_t inst,
lldb::ByteOrder order )
inline

Definition at line 175 of file Opcode.h.

References eType8, inst, m_byte_order, m_data, and m_type.

◆ SetOpcodeBytes()

void lldb_private::Opcode::SetOpcodeBytes ( const void * bytes,
size_t length )
inline

Definition at line 210 of file Opcode.h.

References bytes, DoSetOpcodeBytes(), lldb::eByteOrderInvalid, eTypeBytes, and length.

◆ lldb::SBInstruction

friend class lldb::SBInstruction
friend

Definition at line 261 of file Opcode.h.

Member Data Documentation

◆ bytes

uint8_t lldb_private::Opcode::bytes[kMaxByteSize]

Definition at line 302 of file Opcode.h.

Referenced by DoSetOpcodeBytes(), Opcode(), SetOpcode16_32TupleBytes(), and SetOpcodeBytes().

◆ [struct]

struct { ... } lldb_private::Opcode::inst

◆ inst16

uint16_t lldb_private::Opcode::inst16

Definition at line 298 of file Opcode.h.

◆ inst32

uint32_t lldb_private::Opcode::inst32

Definition at line 299 of file Opcode.h.

◆ inst64

uint64_t lldb_private::Opcode::inst64

Definition at line 300 of file Opcode.h.

◆ inst8

uint8_t lldb_private::Opcode::inst8

Definition at line 297 of file Opcode.h.

◆ kMaxByteSize

size_t lldb_private::Opcode::kMaxByteSize = 16
staticconstexpr

The size in bytes of the fixed buffer used to store opcode bytes.

It must be big enough to hold the longest opcode of any supported target (x86 caps instructions at 15 bytes).

Definition at line 49 of file Opcode.h.

Referenced by InstructionLLVMC::Decode().

◆ length

uint8_t lldb_private::Opcode::length

Definition at line 304 of file Opcode.h.

Referenced by DoSetOpcodeBytes(), Opcode(), SetOpcode16_32TupleBytes(), and SetOpcodeBytes().

◆ m_byte_order

◆ [union]

◆ m_type


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