diff options
Diffstat (limited to 'lldb/source/Plugins/Architecture/Mips')
-rw-r--r-- | lldb/source/Plugins/Architecture/Mips/ArchitectureMips.cpp | 16 | ||||
-rw-r--r-- | lldb/source/Plugins/Architecture/Mips/ArchitectureMips.h | 9 |
2 files changed, 12 insertions, 13 deletions
diff --git a/lldb/source/Plugins/Architecture/Mips/ArchitectureMips.cpp b/lldb/source/Plugins/Architecture/Mips/ArchitectureMips.cpp index 5f2f6eeb8261..22508969ceed 100644 --- a/lldb/source/Plugins/Architecture/Mips/ArchitectureMips.cpp +++ b/lldb/source/Plugins/Architecture/Mips/ArchitectureMips.cpp @@ -1,4 +1,4 @@ -//===-- ArchitectureMips.cpp -------------------------------------*- C++ -*-===// +//===-- ArchitectureMips.cpp ----------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -21,6 +21,8 @@ using namespace lldb_private; using namespace lldb; +LLDB_PLUGIN_DEFINE(ArchitectureMips) + ConstString ArchitectureMips::GetPluginNameStatic() { return ConstString("mips"); } @@ -118,9 +120,7 @@ lldb::addr_t ArchitectureMips::GetBreakableLoadAddress(lldb::addr_t addr, if (current_offset == 0) return addr; - ExecutionContext ctx; - target.CalculateExecutionContext(ctx); - auto insn = GetInstructionAtAddress(ctx, current_offset, addr); + auto insn = GetInstructionAtAddress(target, current_offset, addr); if (nullptr == insn || !insn->HasDelaySlot()) return addr; @@ -136,8 +136,7 @@ lldb::addr_t ArchitectureMips::GetBreakableLoadAddress(lldb::addr_t addr, } Instruction *ArchitectureMips::GetInstructionAtAddress( - const ExecutionContext &exe_ctx, const Address &resolved_addr, - addr_t symbol_offset) const { + Target &target, const Address &resolved_addr, addr_t symbol_offset) const { auto loop_count = symbol_offset / 2; @@ -169,10 +168,11 @@ Instruction *ArchitectureMips::GetInstructionAtAddress( for (uint32_t i = 1; i <= loop_count; i++) { // Adjust the address to read from. addr.Slide(-2); - AddressRange range(addr, i * 2); uint32_t insn_size = 0; - disasm_sp->ParseInstructions(&exe_ctx, range, nullptr, prefer_file_cache); + disasm_sp->ParseInstructions(target, addr, + {Disassembler::Limit::Bytes, i * 2}, nullptr, + prefer_file_cache); uint32_t num_insns = disasm_sp->GetInstructionList().GetSize(); if (num_insns) { diff --git a/lldb/source/Plugins/Architecture/Mips/ArchitectureMips.h b/lldb/source/Plugins/Architecture/Mips/ArchitectureMips.h index a15991ff9ebf..71ee60184b69 100644 --- a/lldb/source/Plugins/Architecture/Mips/ArchitectureMips.h +++ b/lldb/source/Plugins/Architecture/Mips/ArchitectureMips.h @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLDB_PLUGIN_ARCHITECTURE_MIPS_H -#define LLDB_PLUGIN_ARCHITECTURE_MIPS_H +#ifndef LLDB_SOURCE_PLUGINS_ARCHITECTURE_MIPS_ARCHITECTUREMIPS_H +#define LLDB_SOURCE_PLUGINS_ARCHITECTURE_MIPS_ARCHITECTUREMIPS_H #include "lldb/Core/Architecture.h" #include "lldb/Utility/ArchSpec.h" @@ -35,11 +35,10 @@ public: AddressClass addr_class) const override; private: - Instruction *GetInstructionAtAddress(const ExecutionContext &exe_ctx, + Instruction *GetInstructionAtAddress(Target &target, const Address &resolved_addr, lldb::addr_t symbol_offset) const; - static std::unique_ptr<Architecture> Create(const ArchSpec &arch); ArchitectureMips(const ArchSpec &arch) : m_arch(arch) {} @@ -48,4 +47,4 @@ private: } // namespace lldb_private -#endif // LLDB_PLUGIN_ARCHITECTURE_MIPS_H +#endif // LLDB_SOURCE_PLUGINS_ARCHITECTURE_MIPS_ARCHITECTUREMIPS_H |