本文整理汇总了C++中lldb_private::CompilerType::IsAggregateType方法的典型用法代码示例。如果您正苦于以下问题:C++ CompilerType::IsAggregateType方法的具体用法?C++ CompilerType::IsAggregateType怎么用?C++ CompilerType::IsAggregateType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lldb_private::CompilerType
的用法示例。
在下文中一共展示了CompilerType::IsAggregateType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
value.GetScalar() = (int16_t)(reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT16_MAX);
else
value.GetScalar() = (uint16_t)(reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT16_MAX);
break;
case 8:
if (is_signed)
value.GetScalar() = (int8_t)(reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT8_MAX);
else
value.GetScalar() = (uint8_t)(reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT8_MAX);
break;
}
}
else if (compiler_type.IsPointerType ())
{
uint32_t ptr = thread.GetRegisterContext()->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT32_MAX;
value.GetScalar() = ptr;
}
else if (compiler_type.IsVectorType(nullptr, nullptr))
{
size_t byte_size = compiler_type.GetByteSize(&thread);
if (byte_size <= 16)
{
DataBufferHeap buffer(16, 0);
uint32_t* buffer_ptr = (uint32_t*)buffer.GetBytes();
for (uint32_t i = 0; 4*i < byte_size; ++i)
{
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG1 + i);
buffer_ptr[i] = reg_ctx->ReadRegisterAsUnsigned(reg_info, 0) & UINT32_MAX;
}
value.SetBytes(buffer.GetBytes(), byte_size);
}
else
{
if (!GetReturnValuePassedInMemory(thread, reg_ctx, byte_size, value))
return return_valobj_sp;
}
}
else if (compiler_type.IsFloatingPointType(float_count, is_complex))
{
if (float_count == 1 && !is_complex)
{
switch (bit_width)
{
default:
return return_valobj_sp;
case 64:
{
static_assert(sizeof(double) == sizeof(uint64_t), "");
const RegisterInfo *r1_reg_info = reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG2);
uint64_t raw_value;
raw_value = reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT32_MAX;
raw_value |= ((uint64_t)(reg_ctx->ReadRegisterAsUnsigned(r1_reg_info, 0) & UINT32_MAX)) << 32;
value.GetScalar() = *reinterpret_cast<double*>(&raw_value);
break;
}
case 16: // Half precision returned after a conversion to single precision
case 32:
{
static_assert(sizeof(float) == sizeof(uint32_t), "");
uint32_t raw_value = reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT32_MAX;
value.GetScalar() = *reinterpret_cast<float*>(&raw_value);
break;
}
}
}
else
{
// not handled yet
return return_valobj_sp;
}
}
else if (compiler_type.IsAggregateType())
{
size_t byte_size = compiler_type.GetByteSize(&thread);
if (byte_size <= 4)
{
RegisterValue r0_reg_value;
uint32_t raw_value = reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT32_MAX;
value.SetBytes(&raw_value, byte_size);
}
else
{
if (!GetReturnValuePassedInMemory(thread, reg_ctx, byte_size, value))
return return_valobj_sp;
}
}
else
{
// not handled yet
return return_valobj_sp;
}
// If we get here, we have a valid Value, so make our ValueObject out of it:
return_valobj_sp = ValueObjectConstResult::Create(thread.GetStackFrameAtIndex(0).get(),
value,
ConstString(""));
return return_valobj_sp;
}