forked from OSchip/llvm-project
Change the ABI class to have a weak pointer to its Process;
some methods in the ABI need a Process to do their work. Instead of passing it in as a one-off argument to those methods, this patch puts it in the base class and the methods can retrieve if it needed. Note that ABI's are sometimes built without a Process (e.g. SBTarget::GetStackRedZoneSize) so it's entirely possible that the process weak pointer will not be able to reconsistitue into a strong pointer. <rdar://problem/32526754> llvm-svn: 306633
This commit is contained in:
parent
8e07cadde0
commit
43294c9f48
|
@ -92,6 +92,16 @@ protected:
|
|||
virtual lldb::ValueObjectSP
|
||||
GetReturnValueObjectImpl(Thread &thread, llvm::Type &ir_type) const;
|
||||
|
||||
//------------------------------------------------------------------
|
||||
/// Request to get a Process shared pointer.
|
||||
///
|
||||
/// This ABI object may not have been created with a Process object,
|
||||
/// or the Process object may no longer be alive. Be sure to handle
|
||||
/// the case where the shared pointer returned does not have an
|
||||
/// object inside it.
|
||||
//------------------------------------------------------------------
|
||||
lldb::ProcessSP GetProcessSP() const { return m_process_wp.lock(); }
|
||||
|
||||
public:
|
||||
virtual bool CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) = 0;
|
||||
|
||||
|
@ -131,13 +141,18 @@ public:
|
|||
|
||||
virtual bool GetPointerReturnRegister(const char *&name) { return false; }
|
||||
|
||||
static lldb::ABISP FindPlugin(const ArchSpec &arch);
|
||||
static lldb::ABISP FindPlugin(lldb::ProcessSP process_sp, const ArchSpec &arch);
|
||||
|
||||
protected:
|
||||
//------------------------------------------------------------------
|
||||
// Classes that inherit from ABI can see and modify these
|
||||
//------------------------------------------------------------------
|
||||
ABI();
|
||||
ABI(lldb::ProcessSP process_sp) {
|
||||
if (process_sp.get())
|
||||
m_process_wp = process_sp;
|
||||
}
|
||||
|
||||
lldb::ProcessWP m_process_wp;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(ABI);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <set>
|
||||
|
||||
namespace lldb_private {
|
||||
typedef lldb::ABISP (*ABICreateInstance)(const ArchSpec &arch);
|
||||
typedef lldb::ABISP (*ABICreateInstance)(lldb::ProcessSP process_sp, const ArchSpec &arch);
|
||||
typedef Disassembler *(*DisassemblerCreateInstance)(const ArchSpec &arch,
|
||||
const char *flavor);
|
||||
typedef DynamicLoader *(*DynamicLoaderCreateInstance)(Process *process,
|
||||
|
|
|
@ -2170,7 +2170,7 @@ lldb::addr_t SBTarget::GetStackRedZoneSize() {
|
|||
if (process_sp)
|
||||
abi_sp = process_sp->GetABI();
|
||||
else
|
||||
abi_sp = ABI::FindPlugin(target_sp->GetArchitecture());
|
||||
abi_sp = ABI::FindPlugin(ProcessSP(), target_sp->GetArchitecture());
|
||||
if (abi_sp)
|
||||
return abi_sp->GetRedZoneSize();
|
||||
}
|
||||
|
|
|
@ -1326,7 +1326,7 @@ size_t ABIMacOSX_arm::GetRedZoneSize() const { return 0; }
|
|||
//------------------------------------------------------------------
|
||||
|
||||
ABISP
|
||||
ABIMacOSX_arm::CreateInstance(const ArchSpec &arch) {
|
||||
ABIMacOSX_arm::CreateInstance(ProcessSP process_sp, const ArchSpec &arch) {
|
||||
static ABISP g_abi_sp;
|
||||
const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
|
||||
const llvm::Triple::VendorType vendor_type = arch.GetTriple().getVendor();
|
||||
|
@ -1335,7 +1335,7 @@ ABIMacOSX_arm::CreateInstance(const ArchSpec &arch) {
|
|||
if ((arch_type == llvm::Triple::arm) ||
|
||||
(arch_type == llvm::Triple::thumb)) {
|
||||
if (!g_abi_sp)
|
||||
g_abi_sp.reset(new ABIMacOSX_arm);
|
||||
g_abi_sp.reset(new ABIMacOSX_arm(process_sp));
|
||||
return g_abi_sp;
|
||||
}
|
||||
}
|
||||
|
@ -1546,16 +1546,14 @@ bool ABIMacOSX_arm::GetArgumentValues(Thread &thread, ValueList &values) const {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool ABIMacOSX_arm::IsArmv7kProcess(Thread *thread) const {
|
||||
bool ABIMacOSX_arm::IsArmv7kProcess() const {
|
||||
bool is_armv7k = false;
|
||||
if (thread) {
|
||||
ProcessSP process_sp(thread->GetProcess());
|
||||
if (process_sp) {
|
||||
const ArchSpec &arch(process_sp->GetTarget().GetArchitecture());
|
||||
const ArchSpec::Core system_core = arch.GetCore();
|
||||
if (system_core == ArchSpec::eCore_arm_armv7k) {
|
||||
is_armv7k = true;
|
||||
}
|
||||
ProcessSP process_sp(GetProcessSP());
|
||||
if (process_sp) {
|
||||
const ArchSpec &arch(process_sp->GetTarget().GetArchitecture());
|
||||
const ArchSpec::Core system_core = arch.GetCore();
|
||||
if (system_core == ArchSpec::eCore_arm_armv7k) {
|
||||
is_armv7k = true;
|
||||
}
|
||||
}
|
||||
return is_armv7k;
|
||||
|
@ -1588,7 +1586,7 @@ ValueObjectSP ABIMacOSX_arm::GetReturnValueObjectImpl(
|
|||
default:
|
||||
return return_valobj_sp;
|
||||
case 128:
|
||||
if (IsArmv7kProcess(&thread)) {
|
||||
if (IsArmv7kProcess()) {
|
||||
// "A composite type not larger than 16 bytes is returned in r0-r3. The
|
||||
// format is
|
||||
// as if the result had been stored in memory at a word-aligned address
|
||||
|
@ -1755,8 +1753,7 @@ Status ABIMacOSX_arm::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
|
|||
set_it_simple = true;
|
||||
}
|
||||
}
|
||||
} else if (num_bytes <= 16 &&
|
||||
IsArmv7kProcess(frame_sp->GetThread().get())) {
|
||||
} else if (num_bytes <= 16 && IsArmv7kProcess()) {
|
||||
// "A composite type not larger than 16 bytes is returned in r0-r3. The
|
||||
// format is
|
||||
// as if the result had been stored in memory at a word-aligned address
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
const lldb_private::RegisterInfo *
|
||||
GetRegisterInfoArray(uint32_t &count) override;
|
||||
|
||||
bool IsArmv7kProcess(lldb_private::Thread *thread) const;
|
||||
bool IsArmv7kProcess() const;
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// Static Functions
|
||||
|
@ -76,7 +76,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ABISP CreateInstance(const lldb_private::ArchSpec &arch);
|
||||
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
|
||||
|
@ -94,7 +94,7 @@ protected:
|
|||
lldb_private::CompilerType &ast_type) const override;
|
||||
|
||||
private:
|
||||
ABIMacOSX_arm() : lldb_private::ABI() {
|
||||
ABIMacOSX_arm(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
|
||||
// Call CreateInstance instead.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1666,7 +1666,7 @@ size_t ABIMacOSX_arm64::GetRedZoneSize() const { return 128; }
|
|||
//------------------------------------------------------------------
|
||||
|
||||
ABISP
|
||||
ABIMacOSX_arm64::CreateInstance(const ArchSpec &arch) {
|
||||
ABIMacOSX_arm64::CreateInstance(ProcessSP process_sp, const ArchSpec &arch) {
|
||||
static ABISP g_abi_sp;
|
||||
const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
|
||||
const llvm::Triple::VendorType vendor_type = arch.GetTriple().getVendor();
|
||||
|
@ -1674,7 +1674,7 @@ ABIMacOSX_arm64::CreateInstance(const ArchSpec &arch) {
|
|||
if (vendor_type == llvm::Triple::Apple) {
|
||||
if (arch_type == llvm::Triple::aarch64) {
|
||||
if (!g_abi_sp)
|
||||
g_abi_sp.reset(new ABIMacOSX_arm64);
|
||||
g_abi_sp.reset(new ABIMacOSX_arm64(process_sp));
|
||||
return g_abi_sp;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ABISP CreateInstance(const lldb_private::ArchSpec &arch);
|
||||
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// PluginInterface protocol
|
||||
|
@ -102,7 +102,7 @@ protected:
|
|||
lldb_private::CompilerType &ast_type) const override;
|
||||
|
||||
private:
|
||||
ABIMacOSX_arm64() : lldb_private::ABI() {
|
||||
ABIMacOSX_arm64(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
|
||||
// Call CreateInstance instead.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -713,13 +713,13 @@ size_t ABIMacOSX_i386::GetRedZoneSize() const { return 0; }
|
|||
//------------------------------------------------------------------
|
||||
|
||||
ABISP
|
||||
ABIMacOSX_i386::CreateInstance(const ArchSpec &arch) {
|
||||
ABIMacOSX_i386::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
static ABISP g_abi_sp;
|
||||
if ((arch.GetTriple().getArch() == llvm::Triple::x86) &&
|
||||
(arch.GetTriple().isMacOSX() || arch.GetTriple().isiOS() ||
|
||||
arch.GetTriple().isWatchOS())) {
|
||||
if (!g_abi_sp)
|
||||
g_abi_sp.reset(new ABIMacOSX_i386);
|
||||
g_abi_sp.reset(new ABIMacOSX_i386(process_sp));
|
||||
return g_abi_sp;
|
||||
}
|
||||
return ABISP();
|
||||
|
|
|
@ -81,7 +81,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ABISP CreateInstance(const lldb_private::ArchSpec &arch);
|
||||
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// PluginInterface protocol
|
||||
|
@ -101,7 +101,7 @@ protected:
|
|||
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
|
||||
|
||||
private:
|
||||
ABIMacOSX_i386() : lldb_private::ABI() {
|
||||
ABIMacOSX_i386(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
|
||||
// Call CreateInstance instead.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1327,7 +1327,7 @@ size_t ABISysV_arm::GetRedZoneSize() const { return 0; }
|
|||
//------------------------------------------------------------------
|
||||
|
||||
ABISP
|
||||
ABISysV_arm::CreateInstance(const ArchSpec &arch) {
|
||||
ABISysV_arm::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
static ABISP g_abi_sp;
|
||||
const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
|
||||
const llvm::Triple::VendorType vendor_type = arch.GetTriple().getVendor();
|
||||
|
@ -1336,7 +1336,7 @@ ABISysV_arm::CreateInstance(const ArchSpec &arch) {
|
|||
if ((arch_type == llvm::Triple::arm) ||
|
||||
(arch_type == llvm::Triple::thumb)) {
|
||||
if (!g_abi_sp)
|
||||
g_abi_sp.reset(new ABISysV_arm);
|
||||
g_abi_sp.reset(new ABISysV_arm(process_sp));
|
||||
return g_abi_sp;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ABISP CreateInstance(const lldb_private::ArchSpec &arch);
|
||||
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
|
||||
|
@ -94,7 +94,7 @@ protected:
|
|||
lldb_private::CompilerType &ast_type) const override;
|
||||
|
||||
private:
|
||||
ABISysV_arm() : lldb_private::ABI() {
|
||||
ABISysV_arm(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
|
||||
// Call CreateInstance instead.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1670,7 +1670,7 @@ size_t ABISysV_arm64::GetRedZoneSize() const { return 128; }
|
|||
//------------------------------------------------------------------
|
||||
|
||||
ABISP
|
||||
ABISysV_arm64::CreateInstance(const ArchSpec &arch) {
|
||||
ABISysV_arm64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
static ABISP g_abi_sp;
|
||||
const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
|
||||
const llvm::Triple::VendorType vendor_type = arch.GetTriple().getVendor();
|
||||
|
@ -1678,7 +1678,7 @@ ABISysV_arm64::CreateInstance(const ArchSpec &arch) {
|
|||
if (vendor_type != llvm::Triple::Apple) {
|
||||
if (arch_type == llvm::Triple::aarch64) {
|
||||
if (!g_abi_sp)
|
||||
g_abi_sp.reset(new ABISysV_arm64);
|
||||
g_abi_sp.reset(new ABISysV_arm64(process_sp));
|
||||
return g_abi_sp;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ABISP CreateInstance(const lldb_private::ArchSpec &arch);
|
||||
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
|
||||
|
@ -101,7 +101,7 @@ protected:
|
|||
lldb_private::CompilerType &ast_type) const override;
|
||||
|
||||
private:
|
||||
ABISysV_arm64() : lldb_private::ABI() {
|
||||
ABISysV_arm64(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
|
||||
// Call CreateInstance instead.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1019,11 +1019,11 @@ size_t ABISysV_hexagon::GetRedZoneSize() const { return 0; }
|
|||
//------------------------------------------------------------------
|
||||
|
||||
ABISP
|
||||
ABISysV_hexagon::CreateInstance(const ArchSpec &arch) {
|
||||
ABISysV_hexagon::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
static ABISP g_abi_sp;
|
||||
if (arch.GetTriple().getArch() == llvm::Triple::hexagon) {
|
||||
if (!g_abi_sp)
|
||||
g_abi_sp.reset(new ABISysV_hexagon);
|
||||
g_abi_sp.reset(new ABISysV_hexagon(process_sp));
|
||||
return g_abi_sp;
|
||||
}
|
||||
return ABISP();
|
||||
|
|
|
@ -84,7 +84,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ABISP CreateInstance(const lldb_private::ArchSpec &arch);
|
||||
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
|
||||
|
@ -106,7 +106,7 @@ protected:
|
|||
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
|
||||
|
||||
private:
|
||||
ABISysV_hexagon() : lldb_private::ABI() {
|
||||
ABISysV_hexagon(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
|
||||
// Call CreateInstance instead.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -203,12 +203,12 @@ ABISysV_i386::GetRegisterInfoArray(uint32_t &count) {
|
|||
//------------------------------------------------------------------
|
||||
|
||||
ABISP
|
||||
ABISysV_i386::CreateInstance(const ArchSpec &arch) {
|
||||
ABISysV_i386::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
static ABISP g_abi_sp;
|
||||
if ((arch.GetTriple().getArch() == llvm::Triple::x86) &&
|
||||
arch.GetTriple().isOSLinux()) {
|
||||
if (!g_abi_sp)
|
||||
g_abi_sp.reset(new ABISysV_i386);
|
||||
g_abi_sp.reset(new ABISysV_i386(process_sp));
|
||||
return g_abi_sp;
|
||||
}
|
||||
return ABISP();
|
||||
|
|
|
@ -89,7 +89,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ABISP CreateInstance(const lldb_private::ArchSpec &arch);
|
||||
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// PluginInterface protocol
|
||||
|
@ -109,7 +109,7 @@ protected:
|
|||
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
|
||||
|
||||
private:
|
||||
ABISysV_i386() : lldb_private::ABI() {
|
||||
ABISysV_i386(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
|
||||
// Call CreateInstance instead.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -559,13 +559,13 @@ size_t ABISysV_mips::GetRedZoneSize() const { return 0; }
|
|||
//------------------------------------------------------------------
|
||||
|
||||
ABISP
|
||||
ABISysV_mips::CreateInstance(const ArchSpec &arch) {
|
||||
ABISysV_mips::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
static ABISP g_abi_sp;
|
||||
const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
|
||||
if ((arch_type == llvm::Triple::mips) ||
|
||||
(arch_type == llvm::Triple::mipsel)) {
|
||||
if (!g_abi_sp)
|
||||
g_abi_sp.reset(new ABISysV_mips);
|
||||
g_abi_sp.reset(new ABISysV_mips(process_sp));
|
||||
return g_abi_sp;
|
||||
}
|
||||
return ABISP();
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ABISP CreateInstance(const lldb_private::ArchSpec &arch);
|
||||
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
|
||||
|
@ -96,7 +96,7 @@ protected:
|
|||
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
|
||||
|
||||
private:
|
||||
ABISysV_mips() : lldb_private::ABI() {
|
||||
ABISysV_mips(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
|
||||
// Call CreateInstance instead.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -559,13 +559,13 @@ size_t ABISysV_mips64::GetRedZoneSize() const { return 0; }
|
|||
//------------------------------------------------------------------
|
||||
|
||||
ABISP
|
||||
ABISysV_mips64::CreateInstance(const ArchSpec &arch) {
|
||||
ABISysV_mips64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
static ABISP g_abi_sp;
|
||||
const llvm::Triple::ArchType arch_type = arch.GetTriple().getArch();
|
||||
if ((arch_type == llvm::Triple::mips64) ||
|
||||
(arch_type == llvm::Triple::mips64el)) {
|
||||
if (!g_abi_sp)
|
||||
g_abi_sp.reset(new ABISysV_mips64);
|
||||
g_abi_sp.reset(new ABISysV_mips64(process_sp));
|
||||
return g_abi_sp;
|
||||
}
|
||||
return ABISP();
|
||||
|
|
|
@ -87,7 +87,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ABISP CreateInstance(const lldb_private::ArchSpec &arch);
|
||||
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
|
||||
|
@ -109,7 +109,7 @@ protected:
|
|||
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
|
||||
|
||||
private:
|
||||
ABISysV_mips64() : lldb_private::ABI() {
|
||||
ABISysV_mips64(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
|
||||
// Call CreateInstance instead.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -223,11 +223,11 @@ size_t ABISysV_ppc::GetRedZoneSize() const { return 224; }
|
|||
//------------------------------------------------------------------
|
||||
|
||||
ABISP
|
||||
ABISysV_ppc::CreateInstance(const ArchSpec &arch) {
|
||||
ABISysV_ppc::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
static ABISP g_abi_sp;
|
||||
if (arch.GetTriple().getArch() == llvm::Triple::ppc) {
|
||||
if (!g_abi_sp)
|
||||
g_abi_sp.reset(new ABISysV_ppc);
|
||||
g_abi_sp.reset(new ABISysV_ppc(process_sp));
|
||||
return g_abi_sp;
|
||||
}
|
||||
return ABISP();
|
||||
|
|
|
@ -83,7 +83,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ABISP CreateInstance(const lldb_private::ArchSpec &arch);
|
||||
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
|
||||
|
@ -105,7 +105,7 @@ protected:
|
|||
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
|
||||
|
||||
private:
|
||||
ABISysV_ppc() : lldb_private::ABI() {
|
||||
ABISysV_ppc(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
|
||||
// Call CreateInstance instead.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -223,11 +223,11 @@ size_t ABISysV_ppc64::GetRedZoneSize() const { return 224; }
|
|||
//------------------------------------------------------------------
|
||||
|
||||
ABISP
|
||||
ABISysV_ppc64::CreateInstance(const ArchSpec &arch) {
|
||||
ABISysV_ppc64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
static ABISP g_abi_sp;
|
||||
if (arch.GetTriple().getArch() == llvm::Triple::ppc64) {
|
||||
if (!g_abi_sp)
|
||||
g_abi_sp.reset(new ABISysV_ppc64);
|
||||
g_abi_sp.reset(new ABISysV_ppc64(process_sp));
|
||||
return g_abi_sp;
|
||||
}
|
||||
return ABISP();
|
||||
|
|
|
@ -83,7 +83,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ABISP CreateInstance(const lldb_private::ArchSpec &arch);
|
||||
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
|
||||
|
@ -105,7 +105,7 @@ protected:
|
|||
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
|
||||
|
||||
private:
|
||||
ABISysV_ppc64() : lldb_private::ABI() {
|
||||
ABISysV_ppc64(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
|
||||
// Call CreateInstance instead.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -205,11 +205,11 @@ size_t ABISysV_s390x::GetRedZoneSize() const { return 0; }
|
|||
//------------------------------------------------------------------
|
||||
|
||||
ABISP
|
||||
ABISysV_s390x::CreateInstance(const ArchSpec &arch) {
|
||||
ABISysV_s390x::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
static ABISP g_abi_sp;
|
||||
if (arch.GetTriple().getArch() == llvm::Triple::systemz) {
|
||||
if (!g_abi_sp)
|
||||
g_abi_sp.reset(new ABISysV_s390x);
|
||||
g_abi_sp.reset(new ABISysV_s390x(process_sp));
|
||||
return g_abi_sp;
|
||||
}
|
||||
return ABISP();
|
||||
|
|
|
@ -77,7 +77,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ABISP CreateInstance(const lldb_private::ArchSpec &arch);
|
||||
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
|
||||
|
@ -99,7 +99,7 @@ protected:
|
|||
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
|
||||
|
||||
private:
|
||||
ABISysV_s390x() : lldb_private::ABI() {
|
||||
ABISysV_s390x(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
|
||||
// Call CreateInstance instead.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1093,11 +1093,11 @@ size_t ABISysV_x86_64::GetRedZoneSize() const { return 128; }
|
|||
//------------------------------------------------------------------
|
||||
|
||||
ABISP
|
||||
ABISysV_x86_64::CreateInstance(const ArchSpec &arch) {
|
||||
ABISysV_x86_64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
static ABISP g_abi_sp;
|
||||
if (arch.GetTriple().getArch() == llvm::Triple::x86_64) {
|
||||
if (!g_abi_sp)
|
||||
g_abi_sp.reset(new ABISysV_x86_64);
|
||||
g_abi_sp.reset(new ABISysV_x86_64(process_sp));
|
||||
return g_abi_sp;
|
||||
}
|
||||
return ABISP();
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb::ABISP CreateInstance(const lldb_private::ArchSpec &arch);
|
||||
static lldb::ABISP CreateInstance(lldb::ProcessSP process_sp, const lldb_private::ArchSpec &arch);
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
|
||||
|
@ -107,7 +107,7 @@ protected:
|
|||
bool RegisterIsCalleeSaved(const lldb_private::RegisterInfo *reg_info);
|
||||
|
||||
private:
|
||||
ABISysV_x86_64() : lldb_private::ABI() {
|
||||
ABISysV_x86_64(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
|
||||
// Call CreateInstance instead.
|
||||
}
|
||||
};
|
||||
|
|
|
@ -599,7 +599,7 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
|
|||
// gets called in DidAttach, when the target architecture (and
|
||||
// consequently the ABI we'll get from
|
||||
// the process) may be wrong.
|
||||
ABISP abi_to_use = ABI::FindPlugin(arch_to_use);
|
||||
ABISP abi_to_use = ABI::FindPlugin(shared_from_this(), arch_to_use);
|
||||
|
||||
AugmentRegisterInfoViaABI(reg_info, reg_name, abi_to_use);
|
||||
|
||||
|
@ -4419,7 +4419,7 @@ bool ProcessGDBRemote::GetGDBServerRegisterInfo(ArchSpec &arch_to_use) {
|
|||
// that context we haven't
|
||||
// set the Target's architecture yet, so the ABI is also potentially
|
||||
// incorrect.
|
||||
ABISP abi_to_use_sp = ABI::FindPlugin(arch_to_use);
|
||||
ABISP abi_to_use_sp = ABI::FindPlugin(shared_from_this(), arch_to_use);
|
||||
if (feature_node) {
|
||||
ParseRegisters(feature_node, target_info, this->m_register_info,
|
||||
abi_to_use_sp, cur_reg_num, reg_offset);
|
||||
|
|
|
@ -160,7 +160,7 @@ void Variable::Dump(Stream *s, bool show_context) const {
|
|||
if (m_owner_scope) {
|
||||
ModuleSP module_sp(m_owner_scope->CalculateSymbolContextModule());
|
||||
if (module_sp)
|
||||
abi = ABI::FindPlugin(module_sp->GetArchitecture()).get();
|
||||
abi = ABI::FindPlugin(ProcessSP(), module_sp->GetArchitecture()).get();
|
||||
}
|
||||
m_location.GetDescription(s, lldb::eDescriptionLevelBrief,
|
||||
loclist_base_addr, abi);
|
||||
|
@ -471,7 +471,7 @@ bool Variable::DumpLocationForAddress(Stream *s, const Address &address) {
|
|||
if (m_owner_scope) {
|
||||
ModuleSP module_sp(m_owner_scope->CalculateSymbolContextModule());
|
||||
if (module_sp)
|
||||
abi = ABI::FindPlugin(module_sp->GetArchitecture()).get();
|
||||
abi = ABI::FindPlugin(ProcessSP(), module_sp->GetArchitecture()).get();
|
||||
}
|
||||
|
||||
const addr_t file_addr = address.GetFileAddress();
|
||||
|
|
|
@ -25,7 +25,7 @@ using namespace lldb;
|
|||
using namespace lldb_private;
|
||||
|
||||
ABISP
|
||||
ABI::FindPlugin(const ArchSpec &arch) {
|
||||
ABI::FindPlugin(lldb::ProcessSP process_sp, const ArchSpec &arch) {
|
||||
ABISP abi_sp;
|
||||
ABICreateInstance create_callback;
|
||||
|
||||
|
@ -33,7 +33,7 @@ ABI::FindPlugin(const ArchSpec &arch) {
|
|||
(create_callback = PluginManager::GetABICreateCallbackAtIndex(idx)) !=
|
||||
nullptr;
|
||||
++idx) {
|
||||
abi_sp = create_callback(arch);
|
||||
abi_sp = create_callback(process_sp, arch);
|
||||
|
||||
if (abi_sp)
|
||||
return abi_sp;
|
||||
|
@ -42,8 +42,6 @@ ABI::FindPlugin(const ArchSpec &arch) {
|
|||
return abi_sp;
|
||||
}
|
||||
|
||||
ABI::ABI() = default;
|
||||
|
||||
ABI::~ABI() = default;
|
||||
|
||||
bool ABI::GetRegisterInfoByName(const ConstString &name, RegisterInfo &info) {
|
||||
|
|
|
@ -1735,7 +1735,7 @@ addr_t Process::GetImageInfoAddress() { return LLDB_INVALID_ADDRESS; }
|
|||
|
||||
const lldb::ABISP &Process::GetABI() {
|
||||
if (!m_abi_sp)
|
||||
m_abi_sp = ABI::FindPlugin(GetTarget().GetArchitecture());
|
||||
m_abi_sp = ABI::FindPlugin(shared_from_this(), GetTarget().GetArchitecture());
|
||||
return m_abi_sp;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue