本文整理汇总了C++中BVariant::ToInt64方法的典型用法代码示例。如果您正苦于以下问题:C++ BVariant::ToInt64方法的具体用法?C++ BVariant::ToInt64怎么用?C++ BVariant::ToInt64使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BVariant
的用法示例。
在下文中一共展示了BVariant::ToInt64方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TypeContext
status_t
DwarfArrayType::ResolveElementLocation(const ArrayIndexPath& indexPath,
const ValueLocation& parentLocation, ValueLocation*& _location)
{
if (indexPath.CountIndices() != CountDimensions())
return B_BAD_VALUE;
DwarfTypeContext* typeContext = TypeContext();
// If the array entry has a bit stride, get it. Otherwise fall back to the
// element type size.
int64 bitStride;
DIEArrayType* bitStrideOwnerEntry = NULL;
if (fEntry != NULL && (bitStrideOwnerEntry = DwarfUtils::GetDIEByPredicate(
fEntry, HasBitStridePredicate<DIEArrayType>()))) {
BVariant value;
status_t error = typeContext->File()->EvaluateDynamicValue(
typeContext->GetCompilationUnit(), typeContext->AddressSize(),
typeContext->SubprogramEntry(), bitStrideOwnerEntry->BitStride(),
typeContext->TargetInterface(), typeContext->InstructionPointer(),
typeContext->FramePointer(), value);
if (error != B_OK)
return error;
if (!value.IsInteger())
return B_BAD_VALUE;
bitStride = value.ToInt64();
} else
bitStride = BaseType()->ByteSize() * 8;
// Iterate backward through the dimensions and compute the total offset of
// the element.
int64 elementOffset = 0;
DwarfArrayDimension* previousDimension = NULL;
int64 previousDimensionStride = 0;
for (int32 dimensionIndex = CountDimensions() - 1;
dimensionIndex >= 0; dimensionIndex--) {
DwarfArrayDimension* dimension = DwarfDimensionAt(dimensionIndex);
int64 index = indexPath.IndexAt(dimensionIndex);
// If the dimension has a special bit/byte stride, get it.
int64 dimensionStride = 0;
DwarfType* dimensionType = dimension->GetDwarfType();
DIEArrayIndexType* dimensionTypeEntry = dimensionType != NULL
? dynamic_cast<DIEArrayIndexType*>(dimensionType->GetDIEType())
: NULL;
if (dimensionTypeEntry != NULL) {
DIEArrayIndexType* bitStrideOwnerEntry
= DwarfUtils::GetDIEByPredicate(dimensionTypeEntry,
HasBitStridePredicate<DIEArrayIndexType>());
if (bitStrideOwnerEntry != NULL) {
BVariant value;
status_t error = typeContext->File()->EvaluateDynamicValue(
typeContext->GetCompilationUnit(),
typeContext->AddressSize(),
typeContext->SubprogramEntry(),
bitStrideOwnerEntry->BitStride(),
typeContext->TargetInterface(),
typeContext->InstructionPointer(),
typeContext->FramePointer(), value);
if (error != B_OK)
return error;
if (!value.IsInteger())
return B_BAD_VALUE;
dimensionStride = value.ToInt64();
} else {
DIEArrayIndexType* byteStrideOwnerEntry
= DwarfUtils::GetDIEByPredicate(dimensionTypeEntry,
HasByteStridePredicate<DIEArrayIndexType>());
if (byteStrideOwnerEntry != NULL) {
BVariant value;
status_t error = typeContext->File()->EvaluateDynamicValue(
typeContext->GetCompilationUnit(),
typeContext->AddressSize(),
typeContext->SubprogramEntry(),
byteStrideOwnerEntry->ByteStride(),
typeContext->TargetInterface(),
typeContext->InstructionPointer(),
typeContext->FramePointer(), value);
if (error != B_OK)
return error;
if (!value.IsInteger())
return B_BAD_VALUE;
dimensionStride = value.ToInt64() * 8;
}
}
}
// If we don't have a stride for the dimension yet, use the stride of
// the previous dimension multiplied by the size of the dimension.
if (dimensionStride == 0) {
if (previousDimension != NULL) {
dimensionStride = previousDimensionStride
* previousDimension->CountElements();
} else {
// the last dimension -- use the element bit stride
dimensionStride = bitStride;
}
}
// If the dimension stride is still 0 (that can happen, if the dimension
// doesn't have a stride and the previous dimension's element count is
//.........这里部分代码省略.........