本文整理汇总了C++中lldb::DataBufferSP::GetByteSize方法的典型用法代码示例。如果您正苦于以下问题:C++ DataBufferSP::GetByteSize方法的具体用法?C++ DataBufferSP::GetByteSize怎么用?C++ DataBufferSP::GetByteSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lldb::DataBufferSP
的用法示例。
在下文中一共展示了DataBufferSP::GetByteSize方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetRegisterInfoInterface
Status NativeRegisterContextLinux_mips64::WriteAllRegisterValues(
const lldb::DataBufferSP &data_sp) {
Status error;
if (!data_sp) {
error.SetErrorStringWithFormat(
"NativeRegisterContextLinux_mips64::%s invalid data_sp provided",
__FUNCTION__);
return error;
}
if (data_sp->GetByteSize() != REG_CONTEXT_SIZE) {
error.SetErrorStringWithFormat(
"NativeRegisterContextLinux_mips64::%s data_sp contained mismatched "
"data size, expected %" PRIu64 ", actual %" PRIu64,
__FUNCTION__, REG_CONTEXT_SIZE, data_sp->GetByteSize());
return error;
}
uint8_t *src = data_sp->GetBytes();
if (src == nullptr) {
error.SetErrorStringWithFormat("NativeRegisterContextLinux_mips64::%s "
"DataBuffer::GetBytes() returned a null "
"pointer",
__FUNCTION__);
return error;
}
::memcpy(&m_gpr, src, GetRegisterInfoInterface().GetGPRSize());
src += GetRegisterInfoInterface().GetGPRSize();
::memcpy(&m_fpr, src, GetFPRSize());
src += GetFPRSize();
::memcpy(&m_msa, src, sizeof(MSA_linux_mips));
error = WriteGPR();
if (!error.Success()) {
error.SetErrorStringWithFormat(
"NativeRegisterContextLinux_mips64::%s WriteGPR() failed",
__FUNCTION__);
return error;
}
error = WriteCP1();
if (!error.Success()) {
error.SetErrorStringWithFormat(
"NativeRegisterContextLinux_mips64::%s WriteCP1() failed",
__FUNCTION__);
return error;
}
return error;
}
示例2: DoWriteGPR
Status NativeRegisterContextLinux_s390x::WriteAllRegisterValues(
const lldb::DataBufferSP &data_sp) {
Status error;
if (!data_sp) {
error.SetErrorStringWithFormat(
"NativeRegisterContextLinux_s390x::%s invalid data_sp provided",
__FUNCTION__);
return error;
}
if (data_sp->GetByteSize() != REG_CONTEXT_SIZE) {
error.SetErrorStringWithFormat(
"NativeRegisterContextLinux_s390x::%s data_sp contained mismatched "
"data size, expected %" PRIu64 ", actual %" PRIu64,
__FUNCTION__, REG_CONTEXT_SIZE, data_sp->GetByteSize());
return error;
}
uint8_t *src = data_sp->GetBytes();
if (src == nullptr) {
error.SetErrorStringWithFormat("NativeRegisterContextLinux_s390x::%s "
"DataBuffer::GetBytes() returned a null "
"pointer",
__FUNCTION__);
return error;
}
error = DoWriteGPR(src, sizeof(s390_regs));
src += sizeof(s390_regs);
if (error.Fail())
return error;
error = DoWriteFPR(src, sizeof(s390_fp_regs));
src += sizeof(s390_fp_regs);
if (error.Fail())
return error;
// Ignore errors if the regset is unsupported (happens on older kernels).
DoWriteRegisterSet(NT_S390_SYSTEM_CALL, src, 4);
src += 4;
return error;
}
示例3: assert
bool
RegisterContextWindows_x86::WriteAllRegisterValues(const lldb::DataBufferSP &data_sp)
{
assert(data_sp->GetByteSize() >= sizeof(m_context));
memcpy(&m_context, data_sp->GetBytes(), sizeof(m_context));
TargetThreadWindows &wthread = static_cast<TargetThreadWindows &>(m_thread);
if (!::SetThreadContext(wthread.GetHostThread().GetNativeThread().GetSystemHandle(), &m_context))
return false;
return true;
}
示例4: DataBufferHeap
bool
RegisterContextWindows_x86::ReadAllRegisterValues(lldb::DataBufferSP &data_sp)
{
if (!CacheAllRegisterValues())
return false;
if (data_sp->GetByteSize() < sizeof(m_context))
{
data_sp.reset(new DataBufferHeap(sizeof(CONTEXT), 0));
}
memcpy(data_sp->GetBytes(), &m_context, sizeof(m_context));
return true;
}
示例5: GetGPRSize
bool RegisterContextPOSIXProcessMonitor_arm64::WriteAllRegisterValues(
const lldb::DataBufferSP &data_sp) {
bool success = false;
if (data_sp && data_sp->GetByteSize() == REG_CONTEXT_SIZE) {
uint8_t *src = data_sp->GetBytes();
if (src) {
::memcpy(&m_gpr_arm64, src, GetGPRSize());
if (WriteGPR()) {
src += GetGPRSize();
::memcpy(&m_fpr, src, sizeof m_fpr);
success = WriteFPR();
}
}
}
return success;
}
示例6: sizeof
bool RegisterContextDarwin_arm64::WriteAllRegisterValues(
const lldb::DataBufferSP &data_sp) {
if (data_sp && data_sp->GetByteSize() == REG_CONTEXT_SIZE) {
const uint8_t *src = data_sp->GetBytes();
::memcpy(&gpr, src, sizeof(gpr));
src += sizeof(gpr);
::memcpy(&fpu, src, sizeof(fpu));
src += sizeof(gpr);
::memcpy(&exc, src, sizeof(exc));
uint32_t success_count = 0;
if (WriteGPR() == KERN_SUCCESS)
++success_count;
if (WriteFPU() == KERN_SUCCESS)
++success_count;
if (WriteEXC() == KERN_SUCCESS)
++success_count;
return success_count == 3;
}
return false;
}
示例7: GetModuleSpecifications
size_t ObjectContainerUniversalMachO::GetModuleSpecifications(
const lldb_private::FileSpec &file, lldb::DataBufferSP &data_sp,
lldb::offset_t data_offset, lldb::offset_t file_offset,
lldb::offset_t file_size, lldb_private::ModuleSpecList &specs) {
const size_t initial_count = specs.GetSize();
DataExtractor data;
data.SetData(data_sp, data_offset, data_sp->GetByteSize());
if (ObjectContainerUniversalMachO::MagicBytesMatch(data)) {
llvm::MachO::fat_header header;
std::vector<llvm::MachO::fat_arch> fat_archs;
if (ParseHeader(data, header, fat_archs)) {
for (const llvm::MachO::fat_arch &fat_arch : fat_archs) {
const lldb::offset_t slice_file_offset = fat_arch.offset + file_offset;
if (fat_arch.offset < file_size && file_size > slice_file_offset) {
ObjectFile::GetModuleSpecifications(
file, slice_file_offset, file_size - slice_file_offset, specs);
}
}
}
}
return specs.GetSize() - initial_count;
}