1 //===-- ArchitectureMips.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_ARCHITECTURE_MIPS_ARCHITECTUREMIPS_H
10 #define LLDB_SOURCE_PLUGINS_ARCHITECTURE_MIPS_ARCHITECTUREMIPS_H
11 
12 #include "lldb/Core/Architecture.h"
13 #include "lldb/Utility/ArchSpec.h"
14 
15 namespace lldb_private {
16 
17 class ArchitectureMips : public Architecture {
18 public:
19   static llvm::StringRef GetPluginNameStatic() { return "mips"; }
20   static void Initialize();
21   static void Terminate();
22 
23   llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
24 
25   void OverrideStopInfo(Thread &thread) const override {}
26 
27   lldb::addr_t GetBreakableLoadAddress(lldb::addr_t addr,
28                                        Target &) const override;
29 
30   lldb::addr_t GetCallableLoadAddress(lldb::addr_t load_addr,
31                                       AddressClass addr_class) const override;
32 
33   lldb::addr_t GetOpcodeLoadAddress(lldb::addr_t load_addr,
34                                     AddressClass addr_class) const override;
35 
36 private:
37   Instruction *GetInstructionAtAddress(Target &target,
38                                        const Address &resolved_addr,
39                                        lldb::addr_t symbol_offset) const;
40 
41   static std::unique_ptr<Architecture> Create(const ArchSpec &arch);
42   ArchitectureMips(const ArchSpec &arch) : m_arch(arch) {}
43 
44   ArchSpec m_arch;
45 };
46 
47 } // namespace lldb_private
48 
49 #endif // LLDB_SOURCE_PLUGINS_ARCHITECTURE_MIPS_ARCHITECTUREMIPS_H
50