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 ConstString GetPluginNameStatic();
20   static void Initialize();
21   static void Terminate();
22 
23   ConstString GetPluginName() override;
24   uint32_t GetPluginVersion() override;
25 
OverrideStopInfo(Thread & thread)26   void OverrideStopInfo(Thread &thread) const override {}
27 
28   lldb::addr_t GetBreakableLoadAddress(lldb::addr_t addr,
29                                        Target &) const override;
30 
31   lldb::addr_t GetCallableLoadAddress(lldb::addr_t load_addr,
32                                       AddressClass addr_class) const override;
33 
34   lldb::addr_t GetOpcodeLoadAddress(lldb::addr_t load_addr,
35                                     AddressClass addr_class) const override;
36 
37 private:
38   Instruction *GetInstructionAtAddress(Target &target,
39                                        const Address &resolved_addr,
40                                        lldb::addr_t symbol_offset) const;
41 
42   static std::unique_ptr<Architecture> Create(const ArchSpec &arch);
ArchitectureMips(const ArchSpec & arch)43   ArchitectureMips(const ArchSpec &arch) : m_arch(arch) {}
44 
45   ArchSpec m_arch;
46 };
47 
48 } // namespace lldb_private
49 
50 #endif // LLDB_SOURCE_PLUGINS_ARCHITECTURE_MIPS_ARCHITECTUREMIPS_H
51