73 for (
int i = 0; i < 17; ++i)
76 for (
int i = 0; i < 32; ++i)
79 for (
int i = 0; i < 16; ++i)
93 std::map<lldb::addr_t, uint32_t>::iterator pos;
99 ret_val = pos->second;
121 value = llvm::byteswap<uint32_t>(value);
122 *((uint32_t *)dst) = value;
123 }
else if (length == 8) {
133 value1 = llvm::byteswap<uint32_t>(value1);
134 value2 = llvm::byteswap<uint32_t>(value2);
136 ((uint32_t *)dst)[0] = value1;
137 ((uint32_t *)dst)[1] = value2;
150 const void *dst,
size_t length) {
158 memcpy (&value, dst,
sizeof (uint32_t));
160 value = llvm::byteswap<uint32_t>(value);
164 }
else if (length == 8) {
167 memcpy (&value1, dst,
sizeof (uint32_t));
168 memcpy(&value2,
static_cast<const uint8_t *
>(dst) +
sizeof(uint32_t),
171 value1 = llvm::byteswap<uint32_t>(value1);
172 value2 = llvm::byteswap<uint32_t>(value2);
187 if (!baton || !reg_info)
207 if (!baton || !reg_info)
221 for (
int i = 0; match && i < 17; ++i) {
224 out_stream.
Printf(
"r%d: 0x%x != 0x%x\n", i,
m_gpr[i],
225 other_state.
m_gpr[i]);
229 for (
int i = 0; match && i < 32; ++i) {
237 for (
int i = 0; match && i < 16; ++i) {
240 out_stream.
Printf(
"d%d: 0x%" PRIx64
" != 0x%" PRIx64
"\n", i + 16,
248 out_stream.
Printf(
"memory does not match\n");
249 out_stream.
Printf(
"got memory:\n");
251 out_stream.
Printf(
"0x%08" PRIx64
": 0x%08x\n", p.first, p.second);
252 out_stream.
Printf(
"expected memory:\n");
254 out_stream.
Printf(
"0x%08" PRIx64
": 0x%08x\n", p.first, p.second);
263 for (
int i = 0; i < num; ++i) {
265 sstr.
Printf(
"%c%d", kind, i);
267 if (value_sp.get() ==
nullptr)
269 uint64_t reg_value = value_sp->GetValueAs<uint64_t>().value_or(0);
278 static constexpr llvm::StringLiteral memory_key(
"memory");
279 static constexpr llvm::StringLiteral registers_key(
"registers");
288 if (value_sp.get() !=
nullptr) {
289 static constexpr llvm::StringLiteral address_key(
"address");
290 static constexpr llvm::StringLiteral data_key(
"data");
291 uint64_t start_address = 0;
295 if (value_sp.get() ==
nullptr)
298 start_address = value_sp->GetValueAs<uint64_t>().value_or(0);
305 uint32_t num_elts = mem_array->
GetSize();
306 uint32_t address = (uint32_t)start_address;
308 for (uint32_t i = 0; i < num_elts; ++i) {
310 if (value_sp.get() ==
nullptr)
312 uint64_t value = value_sp->GetValueAs<uint64_t>().value_or(0);
314 address = address + 4;
319 if (value_sp.get() ==
nullptr)
328 static constexpr llvm::StringLiteral cpsr_name(
"cpsr");
330 if (value_sp.get() ==
nullptr)
333 value_sp->GetValueAs<uint64_t>().value_or(0));
339 bool found_s_registers =
341 bool found_d_registers =
344 return found_s_registers != found_d_registers;
static bool ReadPseudoRegister(lldb_private::EmulateInstruction *instruction, void *baton, const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue ®_value)
void ClearPseudoRegisters()
static size_t ReadPseudoMemory(lldb_private::EmulateInstruction *instruction, void *baton, const lldb_private::EmulateInstruction::Context &context, lldb::addr_t addr, void *dst, size_t length)
virtual ~EmulationStateARM()
struct EmulationStateARM::_sd_regs m_vfp_regs
bool StorePseudoRegisterValue(uint32_t reg_num, uint64_t value)
static bool WritePseudoRegister(lldb_private::EmulateInstruction *instruction, void *baton, const lldb_private::EmulateInstruction::Context &context, const lldb_private::RegisterInfo *reg_info, const lldb_private::RegisterValue ®_value)
static size_t WritePseudoMemory(lldb_private::EmulateInstruction *instruction, void *baton, const lldb_private::EmulateInstruction::Context &context, lldb::addr_t addr, const void *dst, size_t length)
std::map< lldb::addr_t, uint32_t > m_memory
bool StoreToPseudoAddress(lldb::addr_t p_address, uint32_t value)
uint64_t ReadPseudoRegisterValue(uint32_t reg_num, bool &success)
bool LoadRegistersStateFromDictionary(lldb_private::OptionValueDictionary *reg_dict, char kind, int first_reg, int num)
bool LoadStateFromDictionary(lldb_private::OptionValueDictionary *test_data)
bool CompareState(EmulationStateARM &other_state, lldb_private::Stream &out_stream)
uint32_t ReadFromPseudoAddress(lldb::addr_t p_address, bool &success)
"lldb/Core/EmulateInstruction.h" A class that allows emulation of CPU opcodes.
lldb::OptionValueSP GetValueAtIndex(size_t idx) const
lldb::OptionValueSP GetValueForKey(llvm::StringRef key) const
OptionValueDictionary * GetAsDictionary()
OptionValueArray * GetAsArray()
bool SetUInt(uint64_t uint, uint32_t byte_size)
uint64_t GetAsUInt64(uint64_t fail_value=UINT64_MAX, bool *success_ptr=nullptr) const
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
#define LLDB_INVALID_REGNUM
lldb::ByteOrder InlHostByteOrder()
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::OptionValue > OptionValueSP
@ eRegisterKindDWARF
the register numbers seen DWARF
Every register is described in detail including its name, alternate name (optional),...
uint32_t byte_size
Size in bytes of the register.
uint32_t kinds[lldb::kNumRegisterKinds]
Holds all of the various register numbers for all register kinds.