diff options
Diffstat (limited to 'lldb/source/Plugins/Architecture')
6 files changed, 24 insertions, 21 deletions
diff --git a/lldb/source/Plugins/Architecture/Arm/ArchitectureArm.cpp b/lldb/source/Plugins/Architecture/Arm/ArchitectureArm.cpp index 5b86df6c5273..58c7cbb4530a 100644 --- a/lldb/source/Plugins/Architecture/Arm/ArchitectureArm.cpp +++ b/lldb/source/Plugins/Architecture/Arm/ArchitectureArm.cpp @@ -1,4 +1,4 @@ -//===-- ArchitectureArm.cpp -------------------------------------*- C++ -*-===// +//===-- ArchitectureArm.cpp -----------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -17,6 +17,8 @@ using namespace lldb_private; using namespace lldb; +LLDB_PLUGIN_DEFINE(ArchitectureArm) + ConstString ArchitectureArm::GetPluginNameStatic() { return ConstString("arm"); } diff --git a/lldb/source/Plugins/Architecture/Arm/ArchitectureArm.h b/lldb/source/Plugins/Architecture/Arm/ArchitectureArm.h index 03e79ce524a7..36b79c7c01a1 100644 --- a/lldb/source/Plugins/Architecture/Arm/ArchitectureArm.h +++ b/lldb/source/Plugins/Architecture/Arm/ArchitectureArm.h @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLDB_PLUGIN_ARCHITECTURE_ARM_H -#define LLDB_PLUGIN_ARCHITECTURE_ARM_H +#ifndef LLDB_SOURCE_PLUGINS_ARCHITECTURE_ARM_ARCHITECTUREARM_H +#define LLDB_SOURCE_PLUGINS_ARCHITECTURE_ARM_ARCHITECTUREARM_H #include "lldb/Core/Architecture.h" @@ -37,4 +37,4 @@ private: } // namespace lldb_private -#endif // LLDB_PLUGIN_ARCHITECTURE_ARM_H +#endif // LLDB_SOURCE_PLUGINS_ARCHITECTURE_ARM_ARCHITECTUREARM_H 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 diff --git a/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp b/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp index 76eaa44546eb..94301ecf052c 100644 --- a/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp +++ b/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp @@ -1,4 +1,4 @@ -//===-- ArchitecturePPC64.cpp -----------------------------------*- C++ -*-===// +//===-- ArchitecturePPC64.cpp ---------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -20,6 +20,8 @@ using namespace lldb_private; using namespace lldb; +LLDB_PLUGIN_DEFINE(ArchitecturePPC64) + ConstString ArchitecturePPC64::GetPluginNameStatic() { return ConstString("ppc64"); } diff --git a/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h b/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h index dc663b849c4a..25210d37e53a 100644 --- a/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h +++ b/lldb/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h @@ -6,8 +6,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLDB_PLUGIN_ARCHITECTURE_PPC64_H -#define LLDB_PLUGIN_ARCHITECTURE_PPC64_H +#ifndef LLDB_SOURCE_PLUGINS_ARCHITECTURE_PPC64_ARCHITECTUREPPC64_H +#define LLDB_SOURCE_PLUGINS_ARCHITECTURE_PPC64_ARCHITECTUREPPC64_H #include "lldb/Core/Architecture.h" @@ -38,4 +38,4 @@ private: } // namespace lldb_private -#endif // LLDB_PLUGIN_ARCHITECTURE_PPC64_H +#endif // LLDB_SOURCE_PLUGINS_ARCHITECTURE_PPC64_ARCHITECTUREPPC64_H |