本文整理汇总了C++中BVariant::ToUInt32方法的典型用法代码示例。如果您正苦于以下问题:C++ BVariant::ToUInt32方法的具体用法?C++ BVariant::ToUInt32怎么用?C++ BVariant::ToUInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BVariant
的用法示例。
在下文中一共展示了BVariant::ToUInt32方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
CpuStateX86::SetRegisterValue(const Register* reg, const BVariant& value)
{
int32 index = reg->Index();
if (index >= X86_INT_REGISTER_END)
return false;
fIntRegisters[index] = value.ToUInt32();
fSetRegisters[index] = 1;
return true;
}
示例2: toDwarfMapReference
status_t
DwarfImageDebugInfo::CreateFrame(Image* image,
FunctionInstance* functionInstance, CpuState* cpuState,
StackFrame*& _previousFrame, CpuState*& _previousCpuState)
{
DwarfFunctionDebugInfo* function = dynamic_cast<DwarfFunctionDebugInfo*>(
functionInstance->GetFunctionDebugInfo());
if (function == NULL)
return B_BAD_VALUE;
TRACE_CFI("DwarfImageDebugInfo::CreateFrame(): subprogram DIE: %p\n",
function->SubprogramEntry());
int32 registerCount = fArchitecture->CountRegisters();
const Register* registers = fArchitecture->Registers();
// get the DWARF <-> architecture register maps
RegisterMap* toDwarfMap;
RegisterMap* fromDwarfMap;
status_t error = fArchitecture->GetDwarfRegisterMaps(&toDwarfMap,
&fromDwarfMap);
if (error != B_OK)
return error;
Reference<RegisterMap> toDwarfMapReference(toDwarfMap, true);
Reference<RegisterMap> fromDwarfMapReference(fromDwarfMap, true);
// create a clean CPU state for the previous frame
CpuState* previousCpuState;
error = fArchitecture->CreateCpuState(previousCpuState);
if (error != B_OK)
return error;
Reference<CpuState> previousCpuStateReference(previousCpuState, true);
// create the target interfaces
UnwindTargetInterface* inputInterface
= new(std::nothrow) UnwindTargetInterface(registers, registerCount,
fromDwarfMap, toDwarfMap, cpuState, fArchitecture, fTeamMemory);
if (inputInterface == NULL)
return B_NO_MEMORY;
Reference<UnwindTargetInterface> inputInterfaceReference(inputInterface,
true);
UnwindTargetInterface* outputInterface
= new(std::nothrow) UnwindTargetInterface(registers, registerCount,
fromDwarfMap, toDwarfMap, previousCpuState, fArchitecture,
fTeamMemory);
if (outputInterface == NULL)
return B_NO_MEMORY;
Reference<UnwindTargetInterface> outputInterfaceReference(outputInterface,
true);
// do the unwinding
target_addr_t instructionPointer
= cpuState->InstructionPointer() - fRelocationDelta;
target_addr_t framePointer;
CompilationUnit* unit = function->GetCompilationUnit();
error = fFile->UnwindCallFrame(unit, function->SubprogramEntry(),
instructionPointer, inputInterface, outputInterface, framePointer);
if (error != B_OK) {
TRACE_CFI("Failed to unwind call frame: %s\n", strerror(error));
return B_UNSUPPORTED;
}
TRACE_CFI_ONLY(
TRACE_CFI("unwound registers:\n");
for (int32 i = 0; i < registerCount; i++) {
const Register* reg = registers + i;
BVariant value;
if (previousCpuState->GetRegisterValue(reg, value))
TRACE_CFI(" %3s: %#lx\n", reg->Name(), value.ToUInt32());
else
TRACE_CFI(" %3s: undefined\n", reg->Name());
}
)