本文整理汇总了C++中Address::SetLoadAddress方法的典型用法代码示例。如果您正苦于以下问题:C++ Address::SetLoadAddress方法的具体用法?C++ Address::SetLoadAddress怎么用?C++ Address::SetLoadAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Address
的用法示例。
在下文中一共展示了Address::SetLoadAddress方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: api_locker
lldb::SBAddress
SBValue::GetAddress()
{
Address addr;
if (m_opaque_sp)
{
Target* target = m_opaque_sp->GetUpdatePoint().GetTargetSP().get();
if (target)
{
lldb::addr_t value = LLDB_INVALID_ADDRESS;
Mutex::Locker api_locker (target->GetAPIMutex());
const bool scalar_is_load_address = true;
AddressType addr_type;
value = m_opaque_sp->GetAddressOf(scalar_is_load_address, &addr_type);
if (addr_type == eAddressTypeFile)
{
Module* module = m_opaque_sp->GetModule();
if (module)
module->ResolveFileAddress(value, addr);
}
else if (addr_type == eAddressTypeLoad)
{
// no need to check the return value on this.. if it can actually do the resolve
// addr will be in the form (section,offset), otherwise it will simply be returned
// as (NULL, value)
addr.SetLoadAddress(value, target);
}
}
}
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
if (log)
log->Printf ("SBValue(%p)::GetAddress () => (%s,%llu)", m_opaque_sp.get(), (addr.GetSection() ? addr.GetSection()->GetName().GetCString() : "NULL"), addr.GetOffset());
return SBAddress(new Address(addr));
}
示例2: GetIndexOfInstructionAtAddress
uint32_t
InstructionList::GetIndexOfInstructionAtLoadAddress (lldb::addr_t load_addr, Target &target)
{
Address address;
address.SetLoadAddress(load_addr, &target);
return GetIndexOfInstructionAtAddress(address);
}
示例3:
uint32_t
InstructionList::GetIndexOfInstructionAtLoadAddress (lldb::addr_t load_addr, Target &target)
{
Address address;
address.SetLoadAddress(load_addr, &target);
size_t num_instructions = m_instructions.size();
uint32_t index = UINT32_MAX;
for (size_t i = 0; i < num_instructions; i++)
{
if (m_instructions[i]->GetAddress() == address)
{
index = i;
break;
}
}
return index;
}
示例4: value_sp
lldb::SBAddress
SBValue::GetAddress()
{
Address addr;
ValueLocker locker;
lldb::ValueObjectSP value_sp(GetSP(locker));
if (value_sp)
{
TargetSP target_sp (value_sp->GetTargetSP());
if (target_sp)
{
lldb::addr_t value = LLDB_INVALID_ADDRESS;
const bool scalar_is_load_address = true;
AddressType addr_type;
value = value_sp->GetAddressOf(scalar_is_load_address, &addr_type);
if (addr_type == eAddressTypeFile)
{
ModuleSP module_sp (value_sp->GetModule());
if (module_sp)
module_sp->ResolveFileAddress(value, addr);
}
else if (addr_type == eAddressTypeLoad)
{
// no need to check the return value on this.. if it can actually do the resolve
// addr will be in the form (section,offset), otherwise it will simply be returned
// as (NULL, value)
addr.SetLoadAddress(value, target_sp.get());
}
}
}
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
if (log)
log->Printf ("SBValue(%p)::GetAddress () => (%s,%" PRIu64 ")", value_sp.get(),
(addr.GetSection() ? addr.GetSection()->GetName().GetCString() : "NULL"),
addr.GetOffset());
return SBAddress(new Address(addr));
}