LLDB  mainline
EmulateInstructionPPC64.h
Go to the documentation of this file.
1 //===-- EmulateInstructionPPC64.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_PPC64_EMULATEINSTRUCTIONPPC64_H
10 #define LLDB_SOURCE_PLUGINS_INSTRUCTION_PPC64_EMULATEINSTRUCTIONPPC64_H
11 
14 #include "lldb/Utility/Log.h"
15 
16 namespace lldb_private {
17 
19 public:
20  EmulateInstructionPPC64(const ArchSpec &arch);
21 
22  static void Initialize();
23 
24  static void Terminate();
25 
27 
28  static const char *GetPluginDescriptionStatic();
29 
30  static EmulateInstruction *CreateInstance(const ArchSpec &arch,
31  InstructionType inst_type);
32 
33  static bool
35  switch (inst_type) {
38  return true;
39 
42  return false;
43  }
44  return false;
45  }
46 
47  llvm::StringRef GetPluginName() override {
49  }
50 
51  bool SetTargetTriple(const ArchSpec &arch) override;
52 
55  }
56 
57  bool ReadInstruction() override;
58 
59  bool EvaluateInstruction(uint32_t evaluate_options) override;
60 
61  bool TestEmulation(Stream *out_stream, ArchSpec &arch,
62  OptionValueDictionary *test_data) override {
63  return false;
64  }
65 
66  bool GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num,
67  RegisterInfo &reg_info) override;
68 
69  bool CreateFunctionEntryUnwind(UnwindPlan &unwind_plan) override;
70 
71 private:
72  struct Opcode {
76  const char *name;
77  };
78 
80 
82 
83  bool EmulateMFSPR(uint32_t opcode);
84  bool EmulateLD(uint32_t opcode);
85  bool EmulateSTD(uint32_t opcode);
86  bool EmulateOR(uint32_t opcode);
87  bool EmulateADDI(uint32_t opcode);
88 };
89 
90 } // namespace lldb_private
91 
92 #endif // LLDB_SOURCE_PLUGINS_INSTRUCTION_PPC64_EMULATEINSTRUCTIONPPC64_H
lldb_private::EmulateInstructionPPC64::Opcode::callback
bool(EmulateInstructionPPC64::* callback)(uint32_t opcode)
Definition: EmulateInstructionPPC64.h:75
lldb_private::eInstructionTypePCModifying
@ eInstructionTypePCModifying
Definition: lldb-private-enumerations.h:123
lldb_private::EmulateInstructionPPC64::EmulateADDI
bool EmulateADDI(uint32_t opcode)
Definition: EmulateInstructionPPC64.cpp:362
lldb_private::ArchSpec
Definition: ArchSpec.h:33
LLDB_INVALID_REGNUM
#define LLDB_INVALID_REGNUM
Definition: lldb-defines.h:91
lldb_private::EmulateInstructionPPC64::TestEmulation
bool TestEmulation(Stream *out_stream, ArchSpec &arch, OptionValueDictionary *test_data) override
Definition: EmulateInstructionPPC64.h:61
lldb_private::EmulateInstructionPPC64::GetPluginDescriptionStatic
static const char * GetPluginDescriptionStatic()
Definition: EmulateInstructionPPC64.cpp:47
lldb_private::EmulateInstructionPPC64::Opcode
Definition: EmulateInstructionPPC64.h:72
lldb_private::EmulateInstructionPPC64
Definition: EmulateInstructionPPC64.h:18
lldb_private::EmulateInstructionPPC64::Opcode::value
uint32_t value
Definition: EmulateInstructionPPC64.h:74
lldb_private::Stream
Definition: Stream.h:28
lldb_private::EmulateInstructionPPC64::Initialize
static void Initialize()
Definition: EmulateInstructionPPC64.cpp:33
lldb_private::EmulateInstructionPPC64::Opcode::mask
uint32_t mask
Definition: EmulateInstructionPPC64.h:73
lldb_private::eInstructionTypeAll
@ eInstructionTypeAll
Definition: lldb-private-enumerations.h:125
OptionValue.h
lldb_private::EmulateInstructionPPC64::m_fp
uint32_t m_fp
Definition: EmulateInstructionPPC64.h:79
lldb_private::EmulateInstructionPPC64::Terminate
static void Terminate()
Definition: EmulateInstructionPPC64.cpp:38
lldb_private::EmulateInstructionPPC64::CreateFunctionEntryUnwind
bool CreateFunctionEntryUnwind(UnwindPlan &unwind_plan) override
Definition: EmulateInstructionPPC64.cpp:121
lldb_private::EmulateInstructionPPC64::EmulateMFSPR
bool EmulateMFSPR(uint32_t opcode)
Definition: EmulateInstructionPPC64.cpp:208
EmulateInstruction.h
lldb_private::ConstString::GetStringRef
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
Definition: ConstString.h:202
Log.h
lldb_private::EmulateInstructionPPC64::SupportsEmulatingInstructionsOfType
bool SupportsEmulatingInstructionsOfType(InstructionType inst_type) override
Definition: EmulateInstructionPPC64.h:53
lldb_private::EmulateInstructionPPC64::CreateInstance
static EmulateInstruction * CreateInstance(const ArchSpec &arch, InstructionType inst_type)
Definition: EmulateInstructionPPC64.cpp:52
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::EmulateInstructionPPC64::SupportsEmulatingInstructionsOfTypeStatic
static bool SupportsEmulatingInstructionsOfTypeStatic(InstructionType inst_type)
Definition: EmulateInstructionPPC64.h:34
lldb_private::EmulateInstructionPPC64::ReadInstruction
bool ReadInstruction() override
Definition: EmulateInstructionPPC64.cpp:105
lldb::RegisterKind
RegisterKind
Register numbering types.
Definition: lldb-enumerations.h:227
lldb_private::EmulateInstructionPPC64::GetPluginNameStatic
static ConstString GetPluginNameStatic()
Definition: EmulateInstructionPPC64.cpp:42
lldb_private::EmulateInstructionPPC64::GetPluginName
llvm::StringRef GetPluginName() override
Definition: EmulateInstructionPPC64.h:47
lldb_private::EmulateInstructionPPC64::EmulateLD
bool EmulateLD(uint32_t opcode)
Definition: EmulateInstructionPPC64.cpp:233
lldb_private::EmulateInstructionPPC64::GetRegisterInfo
bool GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num, RegisterInfo &reg_info) override
Definition: EmulateInstructionPPC64.cpp:73
uint32_t
lldb_private::EmulateInstruction
Definition: EmulateInstruction.h:93
lldb_private::EmulateInstructionPPC64::GetOpcodeForInstruction
Opcode * GetOpcodeForInstruction(uint32_t opcode)
Definition: EmulateInstructionPPC64.cpp:141
lldb_private::EmulateInstructionPPC64::EvaluateInstruction
bool EvaluateInstruction(uint32_t evaluate_options) override
Definition: EmulateInstructionPPC64.cpp:164
lldb_private::eInstructionTypePrologueEpilogue
@ eInstructionTypePrologueEpilogue
Definition: lldb-private-enumerations.h:120
lldb_private::InstructionType
InstructionType
Instruction types.
Definition: lldb-private-enumerations.h:118
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::OptionValueDictionary
Definition: OptionValueDictionary.h:18
lldb_private::EmulateInstructionPPC64::Opcode::name
const char * name
Definition: EmulateInstructionPPC64.h:76
lldb_private::EmulateInstructionPPC64::EmulateInstructionPPC64
EmulateInstructionPPC64(const ArchSpec &arch)
Definition: EmulateInstructionPPC64.cpp:30
lldb_private::UnwindPlan
Definition: UnwindPlan.h:53
lldb_private::eInstructionTypeAny
@ eInstructionTypeAny
Definition: lldb-private-enumerations.h:119
lldb_private::EmulateInstructionPPC64::SetTargetTriple
bool SetTargetTriple(const ArchSpec &arch) override
Definition: EmulateInstructionPPC64.cpp:62
lldb_private::EmulateInstructionPPC64::EmulateSTD
bool EmulateSTD(uint32_t opcode)
Definition: EmulateInstructionPPC64.cpp:262
lldb_private::EmulateInstructionPPC64::EmulateOR
bool EmulateOR(uint32_t opcode)
Definition: EmulateInstructionPPC64.cpp:329