LLDB mainline
EmulationStateARM.h
Go to the documentation of this file.
1//===-- EmulationStateARM.h -------------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_SOURCE_PLUGINS_INSTRUCTION_ARM_EMULATIONSTATEARM_H
10#define LLDB_SOURCE_PLUGINS_INSTRUCTION_ARM_EMULATIONSTATEARM_H
11
12#include <map>
13
15#include "lldb/Core/Opcode.h"
16
18public:
20
22
23 bool StorePseudoRegisterValue(uint32_t reg_num, uint64_t value);
24
25 uint64_t ReadPseudoRegisterValue(uint32_t reg_num, bool &success);
26
27 bool StoreToPseudoAddress(lldb::addr_t p_address, uint32_t value);
28
29 uint32_t ReadFromPseudoAddress(lldb::addr_t p_address, bool &success);
30
32
33 void ClearPseudoMemory();
34
36
37 bool CompareState(EmulationStateARM &other_state,
38 lldb_private::Stream &out_stream);
39
40 static size_t
41 ReadPseudoMemory(lldb_private::EmulateInstruction *instruction, void *baton,
43 lldb::addr_t addr, void *dst, size_t length);
44
45 static size_t
48 lldb::addr_t addr, const void *dst, size_t length);
49
51 void *baton,
52 const lldb_private::RegisterInfo *reg_info,
54
55 static bool
57 void *baton,
59 const lldb_private::RegisterInfo *reg_info,
60 const lldb_private::RegisterValue &reg_value);
61
62private:
64 lldb_private::OptionValueDictionary *reg_dict, char kind, int first_reg,
65 int num);
66
67 uint32_t m_gpr[17] = {0};
68 struct _sd_regs {
69 uint32_t s_regs[32]; // sregs 0 - 31 & dregs 0 - 15
70
71 uint64_t d_regs[16]; // dregs 16-31
72
74
75 std::map<lldb::addr_t, uint32_t> m_memory; // Eventually will want to change
76 // uint32_t to a data buffer heap
77 // type.
78
81};
82
83#endif // LLDB_SOURCE_PLUGINS_INSTRUCTION_ARM_EMULATIONSTATEARM_H
static bool ReadPseudoRegister(lldb_private::EmulateInstruction *instruction, void *baton, const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &reg_value)
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 &reg_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)
const EmulationStateARM & operator=(const EmulationStateARM &)=delete
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)
EmulationStateARM(const EmulationStateARM &)=delete
"lldb/Core/EmulateInstruction.h" A class that allows emulation of CPU opcodes.
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
uint64_t addr_t
Definition: lldb-types.h:80
Every register is described in detail including its name, alternate name (optional),...