1 //===-- EmulateInstructionPPC64.h -------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef EmulateInstructionPPC64_h_
11 #define EmulateInstructionPPC64_h_
15 // Other libraries and framework includes
17 #include "lldb/Core/EmulateInstruction.h"
18 #include "lldb/Interpreter/OptionValue.h"
19 #include "lldb/Utility/Log.h"
21 namespace lldb_private {
23 class EmulateInstructionPPC64 : public EmulateInstruction {
25 EmulateInstructionPPC64(const ArchSpec &arch);
27 static void Initialize();
29 static void Terminate();
31 static ConstString GetPluginNameStatic();
33 static const char *GetPluginDescriptionStatic();
35 static EmulateInstruction *CreateInstance(const ArchSpec &arch,
36 InstructionType inst_type);
39 SupportsEmulatingInstructionsOfTypeStatic(InstructionType inst_type) {
41 case eInstructionTypeAny:
42 case eInstructionTypePrologueEpilogue:
45 case eInstructionTypePCModifying:
46 case eInstructionTypeAll:
52 ConstString GetPluginName() override;
54 uint32_t GetPluginVersion() override { return 1; }
56 bool SetTargetTriple(const ArchSpec &arch) override;
58 bool SupportsEmulatingInstructionsOfType(InstructionType inst_type) override {
59 return SupportsEmulatingInstructionsOfTypeStatic(inst_type);
62 bool ReadInstruction() override;
64 bool EvaluateInstruction(uint32_t evaluate_options) override;
66 bool TestEmulation(Stream *out_stream, ArchSpec &arch,
67 OptionValueDictionary *test_data) override {
71 bool GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num,
72 RegisterInfo ®_info) override;
74 bool CreateFunctionEntryUnwind(UnwindPlan &unwind_plan) override;
80 bool (EmulateInstructionPPC64::*callback)(uint32_t opcode);
84 uint32_t m_fp = LLDB_INVALID_REGNUM;
86 Opcode *GetOpcodeForInstruction(uint32_t opcode);
88 bool EmulateMFSPR(uint32_t opcode);
89 bool EmulateLD(uint32_t opcode);
90 bool EmulateSTD(uint32_t opcode);
91 bool EmulateOR(uint32_t opcode);
92 bool EmulateADDI(uint32_t opcode);
95 } // namespace lldb_private
97 #endif // EmulateInstructionPPC64_h_