本文整理汇总了C++中lldb_private::DataExtractor::GetMaxS64方法的典型用法代码示例。如果您正苦于以下问题:C++ DataExtractor::GetMaxS64方法的具体用法?C++ DataExtractor::GetMaxS64怎么用?C++ DataExtractor::GetMaxS64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lldb_private::DataExtractor
的用法示例。
在下文中一共展示了DataExtractor::GetMaxS64方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static bool
GetMaxS64(const lldb_private::DataExtractor &data,
lldb::offset_t *offset,
int64_t *value,
uint32_t byte_size)
{
const lldb::offset_t saved_offset = *offset;
*value = data.GetMaxS64(offset, byte_size);
return *offset != saved_offset;
}
示例2: if
bool
CompilerType::GetValueAsScalar (const lldb_private::DataExtractor &data,
lldb::offset_t data_byte_offset,
size_t data_byte_size,
Scalar &value) const
{
if (!IsValid())
return false;
if (0 == (GetTypeInfo() & eTypeHasValue))
{
return false; // Aggregate types don't have scalar values
}
else
{
uint64_t count = 0;
lldb::Encoding encoding = GetEncoding (count);
if (encoding == lldb::eEncodingInvalid || count != 1)
return false;
const uint64_t byte_size = GetByteSize(nullptr);
lldb::offset_t offset = data_byte_offset;
switch (encoding)
{
case lldb::eEncodingInvalid:
break;
case lldb::eEncodingVector:
break;
case lldb::eEncodingUint:
if (byte_size <= sizeof(unsigned long long))
{
uint64_t uval64 = data.GetMaxU64 (&offset, byte_size);
if (byte_size <= sizeof(unsigned int))
{
value = (unsigned int)uval64;
return true;
}
else if (byte_size <= sizeof(unsigned long))
{
value = (unsigned long)uval64;
return true;
}
else if (byte_size <= sizeof(unsigned long long))
{
value = (unsigned long long )uval64;
return true;
}
else
value.Clear();
}
break;
case lldb::eEncodingSint:
if (byte_size <= sizeof(long long))
{
int64_t sval64 = data.GetMaxS64 (&offset, byte_size);
if (byte_size <= sizeof(int))
{
value = (int)sval64;
return true;
}
else if (byte_size <= sizeof(long))
{
value = (long)sval64;
return true;
}
else if (byte_size <= sizeof(long long))
{
value = (long long )sval64;
return true;
}
else
value.Clear();
}
break;
case lldb::eEncodingIEEE754:
if (byte_size <= sizeof(long double))
{
uint32_t u32;
uint64_t u64;
if (byte_size == sizeof(float))
{
if (sizeof(float) == sizeof(uint32_t))
{
u32 = data.GetU32(&offset);
value = *((float *)&u32);
return true;
}
else if (sizeof(float) == sizeof(uint64_t))
{
u64 = data.GetU64(&offset);
value = *((float *)&u64);
return true;
}
}
else
if (byte_size == sizeof(double))
{
//.........这里部分代码省略.........