uint32_t reg_num, std::string ®_name);
// RegisterInfo variants
- bool ReadRegister(const RegisterInfo *reg_info, RegisterValue ®_value);
+ bool ReadRegister(const RegisterInfo ®_info, RegisterValue ®_value);
- uint64_t ReadRegisterUnsigned(const RegisterInfo *reg_info,
+ uint64_t ReadRegisterUnsigned(const RegisterInfo ®_info,
uint64_t fail_value, bool *success_ptr);
bool WriteRegister(const Context &context, const RegisterInfo *ref_info,
EmulateInstruction::EmulateInstruction(const ArchSpec &arch) : m_arch(arch) {}
-bool EmulateInstruction::ReadRegister(const RegisterInfo *reg_info,
+bool EmulateInstruction::ReadRegister(const RegisterInfo ®_info,
RegisterValue ®_value) {
if (m_read_reg_callback != nullptr)
- return m_read_reg_callback(this, m_baton, reg_info, reg_value);
+ return m_read_reg_callback(this, m_baton, ®_info, reg_value);
return false;
}
RegisterValue ®_value) {
llvm::Optional<RegisterInfo> reg_info = GetRegisterInfo(reg_kind, reg_num);
if (reg_info)
- return ReadRegister(&(*reg_info), reg_value);
+ return ReadRegister(*reg_info, reg_value);
return false;
}
return fail_value;
}
-uint64_t EmulateInstruction::ReadRegisterUnsigned(const RegisterInfo *reg_info,
+uint64_t EmulateInstruction::ReadRegisterUnsigned(const RegisterInfo ®_info,
uint64_t fail_value,
bool *success_ptr) {
RegisterValue reg_value;
GetRegisterInfo(eRegisterKindDWARF, start_reg + d + i);
context.SetRegisterToRegisterPlusOffset(*dwarf_reg, *sp_reg, addr - sp);
// uint64_t to accommodate 64-bit registers.
- uint64_t reg_value = ReadRegisterUnsigned(&(*dwarf_reg), 0, &success);
+ uint64_t reg_value = ReadRegisterUnsigned(*dwarf_reg, 0, &success);
if (!success)
return false;
if (!MemAWrite(context, addr, reg_value, reg_byte_size))
context_t2.SetRegisterToRegisterPlusOffset(*reg_info_Rt2, *reg_info_base,
size);
- if (!ReadRegister(&(*reg_info_Rt), data_Rt))
+ if (!ReadRegister(*reg_info_Rt, data_Rt))
return false;
if (data_Rt.GetAsMemoryData(&(*reg_info_Rt), buffer, reg_info_Rt->byte_size,
if (!WriteMemory(context_t, address + 0, buffer, reg_info_Rt->byte_size))
return false;
- if (!ReadRegister(&(*reg_info_Rt2), data_Rt2))
+ if (!ReadRegister(*reg_info_Rt2, data_Rt2))
return false;
if (data_Rt2.GetAsMemoryData(&(*reg_info_Rt2), buffer,
context.SetRegisterToRegisterPlusOffset(*reg_info_Rt, *reg_info_base,
postindex ? 0 : offset);
- if (!ReadRegister(&(*reg_info_Rt), data_Rt))
+ if (!ReadRegister(*reg_info_Rt, data_Rt))
return false;
if (data_Rt.GetAsMemoryData(&(*reg_info_Rt), buffer, reg_info_Rt->byte_size,
uint8_t buffer[RegisterValue::kMaxRegisterByteSize];
Status error;
- if (!ReadRegister(&(*reg_info_base), data_src))
+ if (!ReadRegister(*reg_info_base, data_src))
return false;
if (data_src.GetAsMemoryData(&(*reg_info_src), buffer,
uint8_t buffer[RegisterValue::kMaxRegisterByteSize];
Status error;
- if (!ReadRegister(&(*reg_info_base), data_src))
+ if (!ReadRegister(*reg_info_base, data_src))
return false;
if (data_src.GetAsMemoryData(®_info_src, buffer, reg_info_src.byte_size,
uint8_t buffer[RegisterValue::kMaxRegisterByteSize];
Status error;
- if (!ReadRegister(&(*reg_info_base), data_src))
+ if (!ReadRegister(*reg_info_base, data_src))
return false;
if (data_src.GetAsMemoryData(&(*reg_info_src), buffer,
uint8_t buffer[RegisterValue::kMaxRegisterByteSize];
Status error;
- if (!ReadRegister(&(*reg_info_base), data_src))
+ if (!ReadRegister(*reg_info_base, data_src))
return false;
if (data_src.GetAsMemoryData(&(*reg_info_src), buffer,