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 
18 public:
20 
21  virtual ~EmulationStateARM();
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 
31  void ClearPseudoRegisters();
32 
33  void ClearPseudoMemory();
34 
36 
38 
39  bool CompareState(EmulationStateARM &other_state);
40 
41  static size_t
42  ReadPseudoMemory(lldb_private::EmulateInstruction *instruction, void *baton,
44  lldb::addr_t addr, void *dst, size_t length);
45 
46  static size_t
47  WritePseudoMemory(lldb_private::EmulateInstruction *instruction, void *baton,
49  lldb::addr_t addr, const void *dst, size_t length);
50 
52  void *baton,
53  const lldb_private::RegisterInfo *reg_info,
54  lldb_private::RegisterValue &reg_value);
55 
56  static bool
58  void *baton,
60  const lldb_private::RegisterInfo *reg_info,
61  const lldb_private::RegisterValue &reg_value);
62 
63 private:
64  uint32_t m_gpr[17] = {0};
65  struct _sd_regs {
66  uint32_t s_regs[32]; // sregs 0 - 31 & dregs 0 - 15
67 
68  uint64_t d_regs[16]; // dregs 16-31
69 
70  } m_vfp_regs;
71 
72  std::map<lldb::addr_t, uint32_t> m_memory; // Eventually will want to change
73  // uint32_t to a data buffer heap
74  // type.
75 
76  EmulationStateARM(const EmulationStateARM &) = delete;
77  const EmulationStateARM &operator=(const EmulationStateARM &) = delete;
78 };
79 
80 #endif // LLDB_SOURCE_PLUGINS_INSTRUCTION_ARM_EMULATIONSTATEARM_H
lldb_private::RegisterValue
Definition: RegisterValue.h:28
Opcode.h
lldb_private::EmulateInstruction::Context
Definition: EmulateInstruction.h:184
EmulationStateARM::m_memory
std::map< lldb::addr_t, uint32_t > m_memory
Definition: EmulationStateARM.h:72
EmulationStateARM::LoadStateFromDictionary
bool LoadStateFromDictionary(lldb_private::OptionValueDictionary *test_data)
Definition: EmulationStateARM.cpp:275
EmulationStateARM::ReadPseudoMemory
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)
Definition: EmulationStateARM.cpp:143
EmulationStateARM::StoreToPseudoAddress
bool StoreToPseudoAddress(lldb::addr_t p_address, uint32_t value)
Definition: EmulationStateARM.cpp:122
EmulationStateARM::ClearPseudoMemory
void ClearPseudoMemory()
Definition: EmulationStateARM.cpp:120
EmulationStateARM::ReadPseudoRegister
static bool ReadPseudoRegister(lldb_private::EmulateInstruction *instruction, void *baton, const lldb_private::RegisterInfo *reg_info, lldb_private::RegisterValue &reg_value)
Definition: EmulationStateARM.cpp:220
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
EmulationStateARM::ClearPseudoRegisters
void ClearPseudoRegisters()
Definition: EmulationStateARM.cpp:109
EmulationStateARM::ReadFromPseudoAddress
uint32_t ReadFromPseudoAddress(lldb::addr_t p_address, bool &success)
Definition: EmulationStateARM.cpp:128
EmulationStateARM::m_gpr
uint32_t m_gpr[17]
Definition: EmulationStateARM.h:64
EmulationStateARM::_sd_regs
Definition: EmulationStateARM.h:65
EmulationStateARM::LoadPseudoRegistersFromFrame
bool LoadPseudoRegistersFromFrame(lldb_private::StackFrame &frame)
Definition: EmulationStateARM.cpp:29
EmulationStateARM::operator=
const EmulationStateARM & operator=(const EmulationStateARM &)=delete
EmulateInstruction.h
EmulationStateARM::m_vfp_regs
struct EmulationStateARM::_sd_regs m_vfp_regs
EmulationStateARM::StorePseudoRegisterValue
bool StorePseudoRegisterValue(uint32_t reg_num, uint64_t value)
Definition: EmulationStateARM.cpp:66
EmulationStateARM::WritePseudoMemory
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)
Definition: EmulationStateARM.cpp:184
EmulationStateARM
Definition: EmulationStateARM.h:17
uint32_t
lldb_private::EmulateInstruction
Definition: EmulateInstruction.h:93
EmulationStateARM::~EmulationStateARM
virtual ~EmulationStateARM()
lldb_private::OptionValueDictionary
Definition: OptionValueDictionary.h:18
EmulationStateARM::EmulationStateARM
EmulationStateARM()
Definition: EmulationStateARM.cpp:23
lldb_private::StackFrame
Definition: StackFrame.h:40
EmulationStateARM::_sd_regs::d_regs
uint64_t d_regs[16]
Definition: EmulationStateARM.h:68
EmulationStateARM::_sd_regs::s_regs
uint32_t s_regs[32]
Definition: EmulationStateARM.h:66
EmulationStateARM::WritePseudoRegister
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)
Definition: EmulationStateARM.cpp:239
EmulationStateARM::ReadPseudoRegisterValue
uint64_t ReadPseudoRegisterValue(uint32_t reg_num, bool &success)
Definition: EmulationStateARM.cpp:86
EmulationStateARM::CompareState
bool CompareState(EmulationStateARM &other_state)
Definition: EmulationStateARM.cpp:254