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

#include "lldb/Core/DataBufferHeap.h"

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

Public Member Functions

 DataBufferHeap ()
 Default constructor. More...
 
 DataBufferHeap (lldb::offset_t n, uint8_t ch)
 Construct with size n and fill with ch. More...
 
 DataBufferHeap (const void *src, lldb::offset_t src_len)
 Construct by making a copy of src_len bytes from src. More...
 
 DataBufferHeap (const DataBuffer &data_buffer)
 Construct by making a copy of a DataBuffer. More...
 
 ~DataBufferHeap () override
 Destructor. More...
 
const uint8_t * GetBytesImpl () const override
 
lldb::offset_t GetByteSize () const override
 
lldb::offset_t SetByteSize (lldb::offset_t byte_size)
 Set the number of bytes in the data buffer. More...
 
void CopyData (const void *src, lldb::offset_t src_len)
 Makes a copy of the src_len bytes in src. More...
 
void CopyData (llvm::StringRef src)
 
void AppendData (const void *src, uint64_t src_len)
 
void Clear ()
 
bool isA (const void *ClassID) const override
 

Static Public Member Functions

static bool classof (const DataBuffer *data_buffer)
 

Static Public Attributes

static char ID
 LLVM RTTI support. More...
 

Private Types

typedef std::vector< uint8_t > buffer_t
 } More...
 

Private Attributes

buffer_t m_data
 The heap based buffer where data is stored. More...
 

Detailed Description

A subclass of DataBuffer that stores a data buffer on the heap.

This class keeps its data in a heap based buffer that is owned by the object. This class is best used to store chunks of data that are created or read from sources that can't intelligently and lazily fault new data pages in. Large amounts of data that comes from files should probably use DataBufferLLVM, which can intelligently determine when memory mapping is optimal.

Definition at line 30 of file DataBufferHeap.h.

Member Typedef Documentation

◆ buffer_t

typedef std::vector<uint8_t> lldb_private::DataBufferHeap::buffer_t
private

}

Buffer type

Definition at line 120 of file DataBufferHeap.h.

Constructor & Destructor Documentation

◆ DataBufferHeap() [1/4]

DataBufferHeap::DataBufferHeap ( )

Default constructor.

Initializes the heap based buffer with no bytes.

Definition at line 15 of file DataBufferHeap.cpp.

◆ DataBufferHeap() [2/4]

DataBufferHeap::DataBufferHeap ( lldb::offset_t  n,
uint8_t  ch 
)

Construct with size n and fill with ch.

Initialize this class with n bytes and fills the buffer with ch.

Parameters
[in]nThe number of bytes that heap based buffer should contain.
[in]chThe character to use when filling the buffer initially.

Definition at line 18 of file DataBufferHeap.cpp.

References m_data.

◆ DataBufferHeap() [3/4]

DataBufferHeap::DataBufferHeap ( const void *  src,
lldb::offset_t  src_len 
)

Construct by making a copy of src_len bytes from src.

Parameters
[in]srcA pointer to the data to copy.
[in]src_lenThe number of bytes in src to copy.

Definition at line 24 of file DataBufferHeap.cpp.

References CopyData().

◆ DataBufferHeap() [4/4]

DataBufferHeap::DataBufferHeap ( const DataBuffer data_buffer)

Construct by making a copy of a DataBuffer.

Parameters
[in]data_bufferA read only data buffer to copy.

Definition at line 29 of file DataBufferHeap.cpp.

References CopyData().

◆ ~DataBufferHeap()

DataBufferHeap::~DataBufferHeap ( )
overridedefault

Destructor.

Virtual destructor since this class inherits from a pure virtual base class DataBuffer.

Member Function Documentation

◆ AppendData()

void DataBufferHeap::AppendData ( const void *  src,
uint64_t  src_len 
)

◆ classof()

static bool lldb_private::DataBufferHeap::classof ( const DataBuffer data_buffer)
inlinestatic

Definition at line 112 of file DataBufferHeap.h.

References ID.

◆ Clear()

void DataBufferHeap::Clear ( )

Definition at line 66 of file DataBufferHeap.cpp.

References m_data.

Referenced by lldb_private::Value::Clear().

◆ CopyData() [1/2]

void DataBufferHeap::CopyData ( const void *  src,
lldb::offset_t  src_len 
)

Makes a copy of the src_len bytes in src.

Copies the data in src into an internal buffer.

Parameters
[in]srcA pointer to the data to copy.
[in]src_lenThe number of bytes in src to copy.

Definition at line 53 of file DataBufferHeap.cpp.

References m_data.

Referenced by DataBufferHeap(), CommandObjectMemoryFind::DoExecute(), lldb_private::ValueObject::GetPointeeData(), lldb_private::Value::operator=(), lldb_private::Value::SetBytes(), and lldb_private::Value::Value().

◆ CopyData() [2/2]

void lldb_private::DataBufferHeap::CopyData ( llvm::StringRef  src)
inline

Definition at line 100 of file DataBufferHeap.h.

References CopyData().

Referenced by CopyData().

◆ GetBytesImpl()

const uint8_t * DataBufferHeap::GetBytesImpl ( ) const
override

Definition at line 38 of file DataBufferHeap.cpp.

References m_data.

◆ GetByteSize()

uint64_t DataBufferHeap::GetByteSize ( ) const
override

Definition at line 43 of file DataBufferHeap.cpp.

References m_data.

Referenced by MinidumpFileBuilder::AddException(), MinidumpFileBuilder::AddModuleList(), MinidumpFileBuilder::AddThreadList(), lldb_private::Value::AppendDataToHostBuffer(), InterpreterStackFrame::AssignValue(), SystemRuntimeMacOSX::CompleteQueueItem(), CommandObjectMemoryFind::DoExecute(), EntityPersistentVariable::DumpToLog(), EntityVariable::DumpToLog(), EntityResultVariable::DumpToLog(), EntitySymbol::DumpToLog(), EntityRegister::DumpToLog(), lldb_private::DWARFExpression::Evaluate(), lldb_private::AppleObjCRuntimeV2::NonPointerISACache::EvaluateNonPointerISA(), lldb_private::formatters::NSSetISyntheticFrontEnd::GetChildAtIndex(), lldb_private::formatters::GenericNSSetMSyntheticFrontEnd< D32, D64 >::GetChildAtIndex(), lldb_private::Value::GetData(), SystemRuntimeMacOSX::GetExtendedBacktraceFromItemRef(), SystemRuntimeMacOSX::GetExtendedBacktraceThread(), GetMacOSXProcessArgs(), lldb_private::IRMemoryMap::GetMemoryData(), SystemRuntimeMacOSX::GetPendingItemRefsForQueue(), GetReturnValuePassedInMemory(), lldb_private::IRExecutionUnit::GetRunnableInfo(), IRInterpreter::Interpret(), lldb_private::Value::operator=(), SystemRuntimeMacOSX::PopulateQueuesUsingLibBTR(), lldb_private::ClassDescriptorV2::class_ro_t::Read(), DynamicLoaderMacOSXDYLD::ReadImageInfos(), lldb::SBTarget::ReadInstructions(), DynamicLoaderDarwinKernel::ReadKextSummaries(), DynamicLoaderMacOSXDYLD::ReadMachHeader(), lldb_private::IRMemoryMap::ReadMemory(), lldb_private::IRMemoryMap::ReadScalarFromMemory(), lldb_private::Value::ResizeData(), InterpreterStackFrame::ResolveConstant(), lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::UpdateISAToDescriptorMap(), lldb_private::AppleObjCRuntimeV2::SharedCacheClassInfoExtractor::UpdateISAToDescriptorMap(), lldb_private::AppleObjCRuntimeV1::UpdateISAToDescriptorMapIfNeeded(), lldb_private::ValueObjectVariable::UpdateValue(), lldb_private::Value::Value(), lldb_private::IRMemoryMap::WriteMemory(), and lldb_private::IRExecutionUnit::WriteNow().

◆ isA()

bool lldb_private::DataBufferHeap::isA ( const void *  ClassID) const
inlineoverride

Definition at line 109 of file DataBufferHeap.h.

References ID.

◆ SetByteSize()

uint64_t DataBufferHeap::SetByteSize ( lldb::offset_t  byte_size)

Set the number of bytes in the data buffer.

Sets the number of bytes that this object should be able to contain. This can be used prior to copying data into the buffer. Note that this zero-initializes up to byte_size bytes.

Parameters
[in]byte_sizeThe new size in bytes that this data buffer should attempt to resize itself to.
Returns
The size in bytes after this heap buffer was resized. If the resize failed the size will remain unchanged.

Definition at line 47 of file DataBufferHeap.cpp.

References m_data.

Referenced by lldb_private::IRMemoryMap::Allocation::Allocation(), lldb_private::ValueObject::GetPointeeData(), lldb_private::Value::ResizeData(), and lldb_private::AppleObjCRuntimeV1::UpdateISAToDescriptorMapIfNeeded().

Member Data Documentation

◆ ID

char DataBufferHeap::ID
static

LLVM RTTI support.

{

Definition at line 108 of file DataBufferHeap.h.

Referenced by classof(), and isA().

◆ m_data

buffer_t lldb_private::DataBufferHeap::m_data
private

The heap based buffer where data is stored.

Definition at line 121 of file DataBufferHeap.h.

Referenced by AppendData(), Clear(), CopyData(), DataBufferHeap(), GetBytesImpl(), GetByteSize(), and SetByteSize().


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