]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/Plugins/Instruction/ARM/EmulationStateARM.h
Update tcpdump to 4.9.2
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / Plugins / Instruction / ARM / EmulationStateARM.h
1 //===-- lldb_EmulationStateARM.h --------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef lldb_EmulationStateARM_h_
11 #define lldb_EmulationStateARM_h_
12
13 #include <map>
14
15 #include "lldb/Core/EmulateInstruction.h"
16 #include "lldb/Core/Opcode.h"
17
18 class EmulationStateARM {
19 public:
20   EmulationStateARM();
21
22   virtual ~EmulationStateARM();
23
24   bool StorePseudoRegisterValue(uint32_t reg_num, uint64_t value);
25
26   uint64_t ReadPseudoRegisterValue(uint32_t reg_num, bool &success);
27
28   bool StoreToPseudoAddress(lldb::addr_t p_address, uint32_t value);
29
30   uint32_t ReadFromPseudoAddress(lldb::addr_t p_address, bool &success);
31
32   void ClearPseudoRegisters();
33
34   void ClearPseudoMemory();
35
36   bool LoadPseudoRegistersFromFrame(lldb_private::StackFrame &frame);
37
38   bool LoadStateFromDictionary(lldb_private::OptionValueDictionary *test_data);
39
40   bool CompareState(EmulationStateARM &other_state);
41
42   static size_t
43   ReadPseudoMemory(lldb_private::EmulateInstruction *instruction, void *baton,
44                    const lldb_private::EmulateInstruction::Context &context,
45                    lldb::addr_t addr, void *dst, size_t length);
46
47   static size_t
48   WritePseudoMemory(lldb_private::EmulateInstruction *instruction, void *baton,
49                     const lldb_private::EmulateInstruction::Context &context,
50                     lldb::addr_t addr, const void *dst, size_t length);
51
52   static bool ReadPseudoRegister(lldb_private::EmulateInstruction *instruction,
53                                  void *baton,
54                                  const lldb_private::RegisterInfo *reg_info,
55                                  lldb_private::RegisterValue &reg_value);
56
57   static bool
58   WritePseudoRegister(lldb_private::EmulateInstruction *instruction,
59                       void *baton,
60                       const lldb_private::EmulateInstruction::Context &context,
61                       const lldb_private::RegisterInfo *reg_info,
62                       const lldb_private::RegisterValue &reg_value);
63
64 private:
65   uint32_t m_gpr[17];
66   struct _sd_regs {
67     uint32_t s_regs[32]; // sregs 0 - 31 & dregs 0 - 15
68
69     uint64_t d_regs[16]; // dregs 16-31
70
71   } m_vfp_regs;
72
73   std::map<lldb::addr_t, uint32_t> m_memory; // Eventually will want to change
74                                              // uint32_t to a data buffer heap
75                                              // type.
76
77   DISALLOW_COPY_AND_ASSIGN(EmulationStateARM);
78 };
79
80 #endif // lldb_EmulationStateARM_h_