[lldb/Plugins] Initialize all ABI plugins by their plugin name
This commit is contained in:
parent
b0840934a7
commit
bcde387f46
@ -22,12 +22,15 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define LLDB_PLUGIN_DEFINE(PluginName) \
|
||||
#define LLDB_PLUGIN_DEFINE_ADV(ClassName, PluginName) \
|
||||
namespace lldb_private { \
|
||||
void lldb_initialize_##PluginName() { PluginName::Initialize(); } \
|
||||
void lldb_terminate_##PluginName() { PluginName::Terminate(); } \
|
||||
void lldb_initialize_##PluginName() { ClassName::Initialize(); } \
|
||||
void lldb_terminate_##PluginName() { ClassName::Terminate(); } \
|
||||
}
|
||||
|
||||
#define LLDB_PLUGIN_DEFINE(PluginName) \
|
||||
LLDB_PLUGIN_DEFINE_ADV(PluginName, PluginName)
|
||||
|
||||
// FIXME: Generate me with CMake
|
||||
#define LLDB_PLUGIN_DECLARE(PluginName) \
|
||||
namespace lldb_private { \
|
||||
|
||||
@ -26,11 +26,11 @@
|
||||
|
||||
LLDB_PLUGIN_DECLARE(ABIAArch64)
|
||||
LLDB_PLUGIN_DECLARE(ABIARM)
|
||||
LLDB_PLUGIN_DECLARE(ABISysV_arc)
|
||||
LLDB_PLUGIN_DECLARE(ABISysV_hexagon)
|
||||
LLDB_PLUGIN_DECLARE(ABIARC)
|
||||
LLDB_PLUGIN_DECLARE(ABIHexagon)
|
||||
LLDB_PLUGIN_DECLARE(ABIMips)
|
||||
LLDB_PLUGIN_DECLARE(ABIPowerPC)
|
||||
LLDB_PLUGIN_DECLARE(ABISysV_s390x)
|
||||
LLDB_PLUGIN_DECLARE(ABISystemZ)
|
||||
LLDB_PLUGIN_DECLARE(ABIX86)
|
||||
LLDB_PLUGIN_DECLARE(ObjectFileBreakpad)
|
||||
LLDB_PLUGIN_DECLARE(ObjectFileELF)
|
||||
@ -116,11 +116,11 @@ SystemInitializerFull::~SystemInitializerFull() {}
|
||||
|
||||
#define LLDB_PROCESS_AArch64(op) op(ABIAArch64);
|
||||
#define LLDB_PROCESS_ARM(op) op(ABIARM);
|
||||
#define LLDB_PROCESS_ARC(op) op(ABISysV_arc);
|
||||
#define LLDB_PROCESS_Hexagon(op) op(ABISysV_hexagon);
|
||||
#define LLDB_PROCESS_ARC(op) op(ABIARC);
|
||||
#define LLDB_PROCESS_Hexagon(op) op(ABIHexagon);
|
||||
#define LLDB_PROCESS_Mips(op) op(ABIMips);
|
||||
#define LLDB_PROCESS_PowerPC(op) op(ABIPowerPC);
|
||||
#define LLDB_PROCESS_SystemZ(op) op(ABISysV_s390x);
|
||||
#define LLDB_PROCESS_SystemZ(op) op(ABISystemZ);
|
||||
#define LLDB_PROCESS_X86(op) op(ABIX86);
|
||||
|
||||
#define LLDB_PROCESS_AMDGPU(op)
|
||||
|
||||
@ -1665,7 +1665,7 @@ ABIMacOSX_arm64::CreateInstance(ProcessSP process_sp, const ArchSpec &arch) {
|
||||
const llvm::Triple::VendorType vendor_type = arch.GetTriple().getVendor();
|
||||
|
||||
if (vendor_type == llvm::Triple::Apple) {
|
||||
if (arch_type == llvm::Triple::aarch64 ||
|
||||
if (arch_type == llvm::Triple::aarch64 ||
|
||||
arch_type == llvm::Triple::aarch64_32) {
|
||||
return ABISP(
|
||||
new ABIMacOSX_arm64(std::move(process_sp), MakeMCRegisterInfo(arch)));
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
using namespace lldb;
|
||||
using namespace lldb_private;
|
||||
|
||||
LLDB_PLUGIN_DEFINE(ABISysV_arc)
|
||||
LLDB_PLUGIN_DEFINE_ADV(ABISysV_arc, ABIARC)
|
||||
|
||||
namespace {
|
||||
namespace dwarf {
|
||||
@ -146,7 +146,7 @@ size_t ABISysV_arc::GetRedZoneSize() const { return 0; }
|
||||
bool ABISysV_arc::IsRegisterFileReduced(RegisterContext ®_ctx) const {
|
||||
if (!m_is_reg_file_reduced) {
|
||||
const auto *const rf_build_reg = reg_ctx.GetRegisterInfoByName("rf_build");
|
||||
|
||||
|
||||
const auto reg_value = reg_ctx.ReadRegisterAsUnsigned(rf_build_reg,
|
||||
/*fail_value*/ 0);
|
||||
// RF_BUILD "Number of Entries" bit.
|
||||
@ -241,7 +241,7 @@ bool ABISysV_arc::PrepareTrivialCall(Thread &thread, addr_t sp, addr_t pc,
|
||||
// Make sure number of parameters matches prototype.
|
||||
assert(!prototype.isFunctionVarArg());
|
||||
assert(prototype.getFunctionNumParams() == args.size());
|
||||
|
||||
|
||||
const size_t regs_for_args_count = IsRegisterFileReduced(*reg_ctx) ? 4U : 8U;
|
||||
|
||||
// Number of arguments passed on stack.
|
||||
|
||||
@ -34,8 +34,6 @@
|
||||
using namespace lldb;
|
||||
using namespace lldb_private;
|
||||
|
||||
LLDB_PLUGIN_DEFINE(ABIMacOSX_arm)
|
||||
|
||||
static RegisterInfo g_register_infos[] = {
|
||||
// NAME ALT SZ OFF ENCODING FORMAT EH_FRAME
|
||||
// DWARF GENERIC PROCESS PLUGIN
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
using namespace lldb;
|
||||
using namespace lldb_private;
|
||||
|
||||
LLDB_PLUGIN_DEFINE(ABISysV_hexagon)
|
||||
LLDB_PLUGIN_DEFINE_ADV(ABISysV_hexagon, ABIHexagon)
|
||||
|
||||
static RegisterInfo g_register_infos[] = {
|
||||
// hexagon-core.xml
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
using namespace lldb;
|
||||
using namespace lldb_private;
|
||||
|
||||
LLDB_PLUGIN_DEFINE(ABISysV_s390x)
|
||||
LLDB_PLUGIN_DEFINE_ADV(ABISysV_s390x, ABISystemZ)
|
||||
|
||||
enum dwarf_regnums {
|
||||
// General Purpose Registers
|
||||
|
||||
@ -17,14 +17,14 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
LLDB_PLUGIN_DECLARE(ABIAArch64);
|
||||
LLDB_PLUGIN_DECLARE(ABIARM);
|
||||
LLDB_PLUGIN_DECLARE(ABISysV_arc);
|
||||
LLDB_PLUGIN_DECLARE(ABISysV_hexagon);
|
||||
LLDB_PLUGIN_DECLARE(ABIMips);
|
||||
LLDB_PLUGIN_DECLARE(ABIPowerPC);
|
||||
LLDB_PLUGIN_DECLARE(ABISysV_s390x);
|
||||
LLDB_PLUGIN_DECLARE(ABIX86);
|
||||
LLDB_PLUGIN_DECLARE(ABIAArch64)
|
||||
LLDB_PLUGIN_DECLARE(ABIARM)
|
||||
LLDB_PLUGIN_DECLARE(ABIARC)
|
||||
LLDB_PLUGIN_DECLARE(ABIHexagon)
|
||||
LLDB_PLUGIN_DECLARE(ABIMips)
|
||||
LLDB_PLUGIN_DECLARE(ABIPowerPC)
|
||||
LLDB_PLUGIN_DECLARE(ABISystemZ)
|
||||
LLDB_PLUGIN_DECLARE(ABIX86)
|
||||
LLDB_PLUGIN_DECLARE(ObjectFileBreakpad)
|
||||
LLDB_PLUGIN_DECLARE(ObjectFileELF)
|
||||
LLDB_PLUGIN_DECLARE(ObjectFileMachO)
|
||||
@ -102,14 +102,14 @@ SystemInitializerTest::~SystemInitializerTest() {}
|
||||
|
||||
#define LLDB_PROCESS_AArch64(op) op(ABIAArch64);
|
||||
#define LLDB_PROCESS_ARM(op) op(ABIARM);
|
||||
#define LLDB_PROCESS_Hexagon(op) op(ABISysV_hexagon);
|
||||
#define LLDB_PROCESS_ARC(op) op(ABIARC);
|
||||
#define LLDB_PROCESS_Hexagon(op) op(ABIHexagon);
|
||||
#define LLDB_PROCESS_Mips(op) op(ABIMips);
|
||||
#define LLDB_PROCESS_PowerPC(op) op(ABIPowerPC);
|
||||
#define LLDB_PROCESS_SystemZ(op) op(ABISysV_s390x);
|
||||
#define LLDB_PROCESS_SystemZ(op) op(ABISystemZ);
|
||||
#define LLDB_PROCESS_X86(op) op(ABIX86);
|
||||
|
||||
#define LLDB_PROCESS_AMDGPU(op)
|
||||
#define LLDB_PROCESS_ARC(op)
|
||||
#define LLDB_PROCESS_AVR(op)
|
||||
#define LLDB_PROCESS_BPF(op)
|
||||
#define LLDB_PROCESS_Lanai(op)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user