LLDB  mainline
Public Member Functions | List of all members
lldb_private::DataBufferHeap Class Reference

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

#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 () override
 Destructor. More...
 
uint8_t * GetBytes () override
 
const uint8_t * GetBytes () 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 ()
 

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.

Constructor & Destructor Documentation

◆ DataBufferHeap() [1/3]

DataBufferHeap::DataBufferHeap ( )

Default constructor.

Initializes the heap based buffer with no bytes.

Definition at line 15 of file DataBufferHeap.cpp.

◆ DataBufferHeap() [2/3]

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.

◆ DataBufferHeap() [3/3]

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(), and ~DataBufferHeap().

◆ ~DataBufferHeap()

DataBufferHeap::~DataBufferHeap ( )
overridedefault

Destructor.

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

Referenced by DataBufferHeap().

Member Function Documentation

◆ AppendData()

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

Definition at line 62 of file DataBufferHeap.cpp.

Referenced by lldb_private::Value::AppendBytes(), and CopyData().

◆ Clear()

void DataBufferHeap::Clear ( )

Definition at line 67 of file DataBufferHeap.cpp.

Referenced by lldb_private::Value::Clear(), and CopyData().

◆ 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 54 of file DataBufferHeap.cpp.

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 97 of file DataBufferHeap.h.

References AppendData(), Clear(), and CopyData().

Referenced by CopyData().

◆ GetBytes() [1/2]

uint8_t * DataBufferHeap::GetBytes ( )
override

Definition at line 34 of file DataBufferHeap.cpp.

Referenced by lldb_private::DataExtractor::Append(), lldb_private::Value::AppendBytes(), 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::formatters::NSSetISyntheticFrontEnd::GetChildAtIndex(), lldb_private::formatters::GenericNSSetMSyntheticFrontEnd< D32, D64 >::GetChildAtIndex(), GetClassDataMask(), lldb_private::Value::GetData(), SystemRuntimeMacOSX::GetExtendedBacktraceFromItemRef(), SystemRuntimeMacOSX::GetExtendedBacktraceThread(), GetMacOSXProcessArgs(), lldb_private::ValueObject::GetPointeeData(), ABISysV_arm::GetReturnValueObjectImpl(), GetReturnValuePassedInMemory(), lldb_private::IRExecutionUnit::GetRunnableInfo(), lldb_private::AppleObjCRuntimeV2::GetTaggedPointerObfuscator(), IRInterpreter::Interpret(), lldb_private::AppleObjCRuntimeV2::LookupRuntimeSymbol(), lldb_private::Value::operator=(), lldb_private::Disassembler::ParseInstructions(), SystemRuntimeMacOSX::PopulateQueueList(), SystemRuntimeMacOSX::PopulateQueuesUsingLibBTR(), InterpreterStackFrame::PrintData(), DynamicLoaderMacOSXDYLD::ReadImageInfos(), DynamicLoaderDarwinKernel::ReadKextSummaries(), DynamicLoaderMacOSXDYLD::ReadMachHeader(), lldb_private::IRMemoryMap::ReadScalarFromMemory(), lldb_private::Value::ResizeData(), InterpreterStackFrame::ResolveConstant(), lldb_private::Value::ResolveValue(), lldb_private::Value::SetBytes(), lldb_private::AppleObjCRuntimeV1::UpdateISAToDescriptorMapIfNeeded(), lldb_private::Value::Value(), and lldb_private::IRExecutionUnit::WriteNow().

◆ GetBytes() [2/2]

const uint8_t * DataBufferHeap::GetBytes ( ) const
override

Definition at line 40 of file DataBufferHeap.cpp.

◆ GetByteSize()

uint64_t DataBufferHeap::GetByteSize ( ) const
override

Definition at line 45 of file DataBufferHeap.cpp.

Referenced by 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::formatters::NSSetISyntheticFrontEnd::GetChildAtIndex(), lldb_private::formatters::GenericNSSetMSyntheticFrontEnd< D32, D64 >::GetChildAtIndex(), GetClassDataMask(), lldb_private::Value::GetData(), SystemRuntimeMacOSX::GetExtendedBacktraceFromItemRef(), SystemRuntimeMacOSX::GetExtendedBacktraceThread(), GetMacOSXProcessArgs(), GetReturnValuePassedInMemory(), lldb_private::IRExecutionUnit::GetRunnableInfo(), lldb_private::AppleObjCRuntimeV2::GetTaggedPointerObfuscator(), IRInterpreter::Interpret(), lldb_private::AppleObjCRuntimeV2::LookupRuntimeSymbol(), lldb_private::Value::operator=(), SystemRuntimeMacOSX::PopulateQueueList(), SystemRuntimeMacOSX::PopulateQueuesUsingLibBTR(), DynamicLoaderMacOSXDYLD::ReadImageInfos(), DynamicLoaderDarwinKernel::ReadKextSummaries(), DynamicLoaderMacOSXDYLD::ReadMachHeader(), lldb_private::IRMemoryMap::ReadScalarFromMemory(), lldb_private::Value::ResizeData(), InterpreterStackFrame::ResolveConstant(), lldb_private::AppleObjCRuntimeV1::UpdateISAToDescriptorMapIfNeeded(), lldb_private::Value::Value(), and lldb_private::IRExecutionUnit::WriteNow().

◆ 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 that this heap buffer was successfully resized to.

Definition at line 49 of file DataBufferHeap.cpp.

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


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