本文整理汇总了C++中lldb_private::CompilerType::IsIntegerType方法的典型用法代码示例。如果您正苦于以下问题:C++ CompilerType::IsIntegerType方法的具体用法?C++ CompilerType::IsIntegerType怎么用?C++ CompilerType::IsIntegerType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lldb_private::CompilerType
的用法示例。
在下文中一共展示了CompilerType::IsIntegerType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
ValueObjectSP
ABISysV_arm::GetReturnValueObjectImpl (Thread &thread,
lldb_private::CompilerType &compiler_type) const
{
Value value;
ValueObjectSP return_valobj_sp;
if (!compiler_type)
return return_valobj_sp;
//value.SetContext (Value::eContextTypeClangType, compiler_type.GetOpaqueQualType());
value.SetCompilerType (compiler_type);
RegisterContext *reg_ctx = thread.GetRegisterContext().get();
if (!reg_ctx)
return return_valobj_sp;
bool is_signed;
bool is_complex;
uint32_t float_count;
// Get the pointer to the first stack argument so we have a place to start
// when reading data
const RegisterInfo *r0_reg_info = reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG1);
size_t bit_width = compiler_type.GetBitSize(&thread);
if (compiler_type.IsIntegerType (is_signed))
{
switch (bit_width)
{
default:
return return_valobj_sp;
case 64:
{
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;
if (is_signed)
value.GetScalar() = (int64_t)raw_value;
else
value.GetScalar() = (uint64_t)raw_value;
}
break;
case 32:
if (is_signed)
value.GetScalar() = (int32_t)(reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT32_MAX);
else
value.GetScalar() = (uint32_t)(reg_ctx->ReadRegisterAsUnsigned(r0_reg_info, 0) & UINT32_MAX);
break;
case 16:
if (is_signed)
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:
//.........这里部分代码省略.........