LLDB mainline
|
A subclass of DataBuffer that stores a data buffer on the heap. More...
#include "lldb/Core/DataBufferHeap.h"
Public Member Functions | |
DataBufferHeap () | |
Default constructor. | |
DataBufferHeap (lldb::offset_t n, uint8_t ch) | |
Construct with size n and fill with ch. | |
DataBufferHeap (const void *src, lldb::offset_t src_len) | |
Construct by making a copy of src_len bytes from src. | |
DataBufferHeap (const DataBuffer &data_buffer) | |
Construct by making a copy of a DataBuffer. | |
~DataBufferHeap () override | |
Destructor. | |
const uint8_t * | GetBytesImpl () const override |
Get a const pointer to the data. | |
lldb::offset_t | GetByteSize () const override |
Get the number of bytes in the data buffer. | |
lldb::offset_t | SetByteSize (lldb::offset_t byte_size) |
Set the number of bytes in the data buffer. | |
void | CopyData (const void *src, lldb::offset_t src_len) |
Makes a copy of the src_len bytes in src. | |
void | CopyData (llvm::StringRef src) |
void | AppendData (const void *src, uint64_t src_len) |
void | Clear () |
bool | isA (const void *ClassID) const override |
Public Member Functions inherited from lldb_private::WritableDataBuffer | |
~WritableDataBuffer () override=default | |
Destructor. | |
uint8_t * | GetBytes () |
Get a pointer to the data. | |
llvm::MutableArrayRef< uint8_t > | GetData () |
bool | isA (const void *ClassID) const override |
const uint8_t * | GetBytes () const |
Get a const pointer to the data. | |
llvm::ArrayRef< uint8_t > | GetData () const |
Public Member Functions inherited from lldb_private::DataBuffer | |
virtual | ~DataBuffer ()=default |
virtual lldb::offset_t | GetByteSize () const =0 |
Get the number of bytes in the data buffer. | |
const uint8_t * | GetBytes () const |
Get a const pointer to the data. | |
llvm::ArrayRef< uint8_t > | GetData () const |
virtual bool | isA (const void *ClassID) const |
Static Public Member Functions | |
static bool | classof (const DataBuffer *data_buffer) |
Static Public Member Functions inherited from lldb_private::WritableDataBuffer | |
static bool | classof (const DataBuffer *data_buffer) |
Static Public Member Functions inherited from lldb_private::DataBuffer | |
static bool | classof (const DataBuffer *data_buffer) |
Static Public Attributes | |
static char | ID |
LLVM RTTI support. | |
Static Public Attributes inherited from lldb_private::WritableDataBuffer | |
static char | ID |
LLVM RTTI support. | |
Static Public Attributes inherited from lldb_private::DataBuffer | |
static char | ID |
LLVM RTTI support. | |
Private Types | |
typedef std::vector< uint8_t > | buffer_t |
} | |
Private Attributes | |
buffer_t | m_data |
The heap based buffer where data is stored. | |
Additional Inherited Members | |
virtual const uint8_t * | GetBytesImpl () const =0 |
} | |
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.
|
private |
DataBufferHeap::DataBufferHeap | ( | ) |
Default constructor.
Initializes the heap based buffer with no bytes.
Definition at line 15 of file DataBufferHeap.cpp.
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.
[in] | n | The number of bytes that heap based buffer should contain. |
[in] | ch | The character to use when filling the buffer initially. |
Definition at line 18 of file DataBufferHeap.cpp.
References m_data.
DataBufferHeap::DataBufferHeap | ( | const void * | src, |
lldb::offset_t | src_len | ||
) |
Construct by making a copy of src_len bytes from src.
[in] | src | A pointer to the data to copy. |
[in] | src_len | The number of bytes in src to copy. |
Definition at line 24 of file DataBufferHeap.cpp.
References CopyData().
DataBufferHeap::DataBufferHeap | ( | const DataBuffer & | data_buffer | ) |
Construct by making a copy of a DataBuffer.
[in] | data_buffer | A read only data buffer to copy. |
Definition at line 29 of file DataBufferHeap.cpp.
References CopyData(), lldb_private::DataBuffer::GetBytes(), and lldb_private::DataBuffer::GetByteSize().
|
overridedefault |
Destructor.
Virtual destructor since this class inherits from a pure virtual base class #DataBuffer.
void DataBufferHeap::AppendData | ( | const void * | src, |
uint64_t | src_len | ||
) |
Definition at line 61 of file DataBufferHeap.cpp.
References m_data.
Referenced by MinidumpFileBuilder::AddData(), MinidumpFileBuilder::AddExceptions(), MinidumpFileBuilder::AddLinuxFileStreams(), MinidumpFileBuilder::AddMemoryList_32(), MinidumpFileBuilder::AddMemoryList_64(), MinidumpFileBuilder::AddMiscInfo(), MinidumpFileBuilder::AddModuleList(), MinidumpFileBuilder::AddSystemInfo(), MinidumpFileBuilder::AddThreadList(), lldb_private::Value::AppendBytes(), and WriteString().
|
inlinestatic |
Definition at line 112 of file DataBufferHeap.h.
References ID, and lldb_private::DataBuffer::isA().
void DataBufferHeap::Clear | ( | ) |
Definition at line 66 of file DataBufferHeap.cpp.
References m_data.
Referenced by lldb_private::Value::Clear(), and MinidumpFileBuilder::FlushBufferToDisk().
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.
[in] | src | A pointer to the data to copy. |
[in] | src_len | The 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().
|
inline |
|
overridevirtual |
Get a const pointer to the data.
Implements lldb_private::DataBuffer.
Definition at line 38 of file DataBufferHeap.cpp.
References m_data.
|
overridevirtual |
Get the number of bytes in the data buffer.
Implements lldb_private::DataBuffer.
Definition at line 43 of file DataBufferHeap.cpp.
References m_data.
Referenced by MinidumpFileBuilder::AddData(), MinidumpFileBuilder::AddModuleList(), MinidumpFileBuilder::AddThreadList(), lldb_private::Value::AppendDataToHostBuffer(), InterpreterStackFrame::AssignValue(), SystemRuntimeMacOSX::CompleteQueueItem(), CommandObjectMemoryFind::DoExecute(), EntityPersistentVariable::DumpToLog(), EntityVariableBase::DumpToLog(), EntityResultVariable::DumpToLog(), EntitySymbol::DumpToLog(), EntityRegister::DumpToLog(), lldb_private::DWARFExpression::Evaluate(), lldb_private::AppleObjCRuntimeV2::NonPointerISACache::EvaluateNonPointerISA(), MinidumpFileBuilder::FlushBufferToDisk(), lldb_private::formatters::NSSetISyntheticFrontEnd::GetChildAtIndex(), lldb_private::formatters::GenericNSSetMSyntheticFrontEnd< D32, D64 >::GetChildAtIndex(), MinidumpFileBuilder::GetCurrentDataEndOffset(), 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(), ReadJITEntry(), DynamicLoaderDarwinKernel::ReadKextSummaries(), DynamicLoaderMacOSXDYLD::ReadMachHeader(), lldb_private::IRMemoryMap::ReadMemory(), lldb_private::IRMemoryMap::ReadScalarFromMemory(), lldb_private::Value::ResizeData(), InterpreterStackFrame::ResolveConstant(), lldb_private::AppleObjCRuntimeV2::SharedCacheClassInfoExtractor::UpdateISAToDescriptorMap(), lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::UpdateISAToDescriptorMap(), lldb_private::AppleObjCRuntimeV1::UpdateISAToDescriptorMapIfNeeded(), lldb_private::ValueObjectVariable::UpdateValue(), lldb_private::Value::Value(), lldb_private::IRMemoryMap::WriteMemory(), and lldb_private::IRExecutionUnit::WriteNow().
|
inlineoverridevirtual |
Reimplemented from lldb_private::WritableDataBuffer.
Definition at line 109 of file DataBufferHeap.h.
References ID, and lldb_private::WritableDataBuffer::isA().
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.
[in] | byte_size | The new size in bytes that this data buffer should attempt to resize itself to. |
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().
|
static |
|
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().