[lldb] Remove ConstString from GetPluginNameStatic of some plugins
This patch deals with ObjectFile, ObjectContainer and OperatingSystem plugins. I'll convert the other types in separate patches. In order to enable piecemeal conversion, I am leaving some ConstStrings in the lowest PluginManager layers. I'll convert those as the last step. Differential Revision: https://reviews.llvm.org/D112061
This commit is contained in:
@@ -121,7 +121,7 @@ public:
|
||||
GetEmulateInstructionCreateCallbackForPluginName(ConstString name);
|
||||
|
||||
// OperatingSystem
|
||||
static bool RegisterPlugin(ConstString name, const char *description,
|
||||
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
|
||||
OperatingSystemCreateInstance create_callback,
|
||||
DebuggerInitializeCallback debugger_init_callback);
|
||||
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
GetOperatingSystemCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static OperatingSystemCreateInstance
|
||||
GetOperatingSystemCreateCallbackForPluginName(ConstString name);
|
||||
GetOperatingSystemCreateCallbackForPluginName(llvm::StringRef name);
|
||||
|
||||
// Language
|
||||
static bool RegisterPlugin(ConstString name, const char *description,
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
|
||||
// ObjectFile
|
||||
static bool
|
||||
RegisterPlugin(ConstString name, const char *description,
|
||||
RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
|
||||
ObjectFileCreateInstance create_callback,
|
||||
ObjectFileCreateMemoryInstance create_memory_callback,
|
||||
ObjectFileGetModuleSpecifications get_module_specifications,
|
||||
@@ -188,16 +188,16 @@ public:
|
||||
GetObjectFileGetModuleSpecificationsCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static ObjectFileCreateMemoryInstance
|
||||
GetObjectFileCreateMemoryCallbackForPluginName(ConstString name);
|
||||
GetObjectFileCreateMemoryCallbackForPluginName(llvm::StringRef name);
|
||||
|
||||
static Status SaveCore(const lldb::ProcessSP &process_sp,
|
||||
const FileSpec &outfile,
|
||||
lldb::SaveCoreStyle &core_style,
|
||||
const ConstString plugin_name);
|
||||
llvm::StringRef plugin_name);
|
||||
|
||||
// ObjectContainer
|
||||
static bool
|
||||
RegisterPlugin(ConstString name, const char *description,
|
||||
RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
|
||||
ObjectContainerCreateInstance create_callback,
|
||||
ObjectFileGetModuleSpecifications get_module_specifications);
|
||||
|
||||
|
||||
@@ -1228,8 +1228,7 @@ lldb::SBError SBProcess::SaveCore(const char *file_name) {
|
||||
|
||||
FileSpec core_file(file_name);
|
||||
SaveCoreStyle core_style = SaveCoreStyle::eSaveCoreFull;
|
||||
error.ref() =
|
||||
PluginManager::SaveCore(process_sp, core_file, core_style, ConstString());
|
||||
error.ref() = PluginManager::SaveCore(process_sp, core_file, core_style, "");
|
||||
return LLDB_RECORD_RESULT(error);
|
||||
}
|
||||
|
||||
|
||||
@@ -1216,7 +1216,7 @@ public:
|
||||
|
||||
switch (short_option) {
|
||||
case 'p':
|
||||
m_requested_plugin_name.SetString(option_arg);
|
||||
m_requested_plugin_name = option_arg.str();
|
||||
break;
|
||||
case 's':
|
||||
m_requested_save_core_style =
|
||||
@@ -1233,12 +1233,12 @@ public:
|
||||
|
||||
void OptionParsingStarting(ExecutionContext *execution_context) override {
|
||||
m_requested_save_core_style = eSaveCoreUnspecified;
|
||||
m_requested_plugin_name.Clear();
|
||||
m_requested_plugin_name.clear();
|
||||
}
|
||||
|
||||
// Instance variables to hold the values for command options.
|
||||
SaveCoreStyle m_requested_save_core_style;
|
||||
ConstString m_requested_plugin_name;
|
||||
std::string m_requested_plugin_name;
|
||||
};
|
||||
|
||||
protected:
|
||||
|
||||
@@ -473,11 +473,12 @@ static OperatingSystemInstances &GetOperatingSystemInstances() {
|
||||
}
|
||||
|
||||
bool PluginManager::RegisterPlugin(
|
||||
ConstString name, const char *description,
|
||||
llvm::StringRef name, llvm::StringRef description,
|
||||
OperatingSystemCreateInstance create_callback,
|
||||
DebuggerInitializeCallback debugger_init_callback) {
|
||||
return GetOperatingSystemInstances().RegisterPlugin(
|
||||
name, description, create_callback, debugger_init_callback);
|
||||
ConstString(name), description.str().c_str(), create_callback,
|
||||
debugger_init_callback);
|
||||
}
|
||||
|
||||
bool PluginManager::UnregisterPlugin(
|
||||
@@ -491,8 +492,9 @@ PluginManager::GetOperatingSystemCreateCallbackAtIndex(uint32_t idx) {
|
||||
}
|
||||
|
||||
OperatingSystemCreateInstance
|
||||
PluginManager::GetOperatingSystemCreateCallbackForPluginName(ConstString name) {
|
||||
return GetOperatingSystemInstances().GetCallbackForName(name);
|
||||
PluginManager::GetOperatingSystemCreateCallbackForPluginName(
|
||||
llvm::StringRef name) {
|
||||
return GetOperatingSystemInstances().GetCallbackForName(ConstString(name));
|
||||
}
|
||||
|
||||
#pragma mark Language
|
||||
@@ -635,14 +637,14 @@ static ObjectFileInstances &GetObjectFileInstances() {
|
||||
}
|
||||
|
||||
bool PluginManager::RegisterPlugin(
|
||||
ConstString name, const char *description,
|
||||
llvm::StringRef name, llvm::StringRef description,
|
||||
ObjectFileCreateInstance create_callback,
|
||||
ObjectFileCreateMemoryInstance create_memory_callback,
|
||||
ObjectFileGetModuleSpecifications get_module_specifications,
|
||||
ObjectFileSaveCore save_core) {
|
||||
return GetObjectFileInstances().RegisterPlugin(
|
||||
name, description, create_callback, create_memory_callback,
|
||||
get_module_specifications, save_core);
|
||||
ConstString(name), description.str().c_str(), create_callback,
|
||||
create_memory_callback, get_module_specifications, save_core);
|
||||
}
|
||||
|
||||
bool PluginManager::UnregisterPlugin(ObjectFileCreateInstance create_callback) {
|
||||
@@ -673,12 +675,10 @@ PluginManager::GetObjectFileGetModuleSpecificationsCallbackAtIndex(
|
||||
|
||||
ObjectFileCreateMemoryInstance
|
||||
PluginManager::GetObjectFileCreateMemoryCallbackForPluginName(
|
||||
ConstString name) {
|
||||
if (!name)
|
||||
return nullptr;
|
||||
llvm::StringRef name) {
|
||||
const auto &instances = GetObjectFileInstances().GetInstances();
|
||||
for (auto &instance : instances) {
|
||||
if (instance.name == name)
|
||||
if (instance.name.GetStringRef() == name)
|
||||
return instance.create_memory_callback;
|
||||
}
|
||||
return nullptr;
|
||||
@@ -687,8 +687,8 @@ PluginManager::GetObjectFileCreateMemoryCallbackForPluginName(
|
||||
Status PluginManager::SaveCore(const lldb::ProcessSP &process_sp,
|
||||
const FileSpec &outfile,
|
||||
lldb::SaveCoreStyle &core_style,
|
||||
const ConstString plugin_name) {
|
||||
if (!plugin_name) {
|
||||
llvm::StringRef plugin_name) {
|
||||
if (plugin_name.empty()) {
|
||||
// Try saving core directly from the process plugin first.
|
||||
llvm::Expected<bool> ret = process_sp->SaveCore(outfile.GetPath());
|
||||
if (!ret)
|
||||
@@ -701,7 +701,7 @@ Status PluginManager::SaveCore(const lldb::ProcessSP &process_sp,
|
||||
Status error;
|
||||
auto &instances = GetObjectFileInstances().GetInstances();
|
||||
for (auto &instance : instances) {
|
||||
if (plugin_name && instance.name != plugin_name)
|
||||
if (instance.name.GetStringRef() != plugin_name)
|
||||
continue;
|
||||
if (instance.save_core &&
|
||||
instance.save_core(process_sp, outfile, core_style, error))
|
||||
@@ -733,11 +733,12 @@ static ObjectContainerInstances &GetObjectContainerInstances() {
|
||||
}
|
||||
|
||||
bool PluginManager::RegisterPlugin(
|
||||
ConstString name, const char *description,
|
||||
llvm::StringRef name, llvm::StringRef description,
|
||||
ObjectContainerCreateInstance create_callback,
|
||||
ObjectFileGetModuleSpecifications get_module_specifications) {
|
||||
return GetObjectContainerInstances().RegisterPlugin(
|
||||
name, description, create_callback, get_module_specifications);
|
||||
ConstString(name), description.str().c_str(), create_callback,
|
||||
get_module_specifications);
|
||||
}
|
||||
|
||||
bool PluginManager::UnregisterPlugin(
|
||||
|
||||
@@ -274,15 +274,6 @@ void ObjectContainerBSDArchive::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
lldb_private::ConstString ObjectContainerBSDArchive::GetPluginNameStatic() {
|
||||
static ConstString g_name("bsd-archive");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ObjectContainerBSDArchive::GetPluginDescriptionStatic() {
|
||||
return "BSD Archive object container reader.";
|
||||
}
|
||||
|
||||
ObjectContainer *ObjectContainerBSDArchive::CreateInstance(
|
||||
const lldb::ModuleSP &module_sp, DataBufferSP &data_sp,
|
||||
lldb::offset_t data_offset, const FileSpec *file,
|
||||
|
||||
@@ -36,9 +36,11 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "bsd-archive"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic() {
|
||||
return "BSD Archive object container reader.";
|
||||
}
|
||||
|
||||
static lldb_private::ObjectContainer *
|
||||
CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
|
||||
@@ -68,9 +70,7 @@ public:
|
||||
lldb::ObjectFileSP GetObjectFile(const lldb_private::FileSpec *file) override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
protected:
|
||||
struct Object {
|
||||
|
||||
@@ -33,15 +33,6 @@ void ObjectContainerUniversalMachO::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
lldb_private::ConstString ObjectContainerUniversalMachO::GetPluginNameStatic() {
|
||||
static ConstString g_name("mach-o");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ObjectContainerUniversalMachO::GetPluginDescriptionStatic() {
|
||||
return "Universal mach-o object container reader.";
|
||||
}
|
||||
|
||||
ObjectContainer *ObjectContainerUniversalMachO::CreateInstance(
|
||||
const lldb::ModuleSP &module_sp, DataBufferSP &data_sp,
|
||||
lldb::offset_t data_offset, const FileSpec *file,
|
||||
|
||||
@@ -28,9 +28,11 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "mach-o"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic() {
|
||||
return "Universal mach-o object container reader.";
|
||||
}
|
||||
|
||||
static lldb_private::ObjectContainer *
|
||||
CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
|
||||
@@ -59,9 +61,7 @@ public:
|
||||
lldb::ObjectFileSP GetObjectFile(const lldb_private::FileSpec *file) override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
protected:
|
||||
llvm::MachO::fat_header m_header;
|
||||
|
||||
@@ -56,11 +56,6 @@ void ObjectFileBreakpad::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
ConstString ObjectFileBreakpad::GetPluginNameStatic() {
|
||||
static ConstString g_name("breakpad");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
ObjectFile *ObjectFileBreakpad::CreateInstance(
|
||||
const ModuleSP &module_sp, DataBufferSP &data_sp, offset_t data_offset,
|
||||
const FileSpec *file, offset_t file_offset, offset_t length) {
|
||||
|
||||
@@ -21,7 +21,7 @@ public:
|
||||
static void Initialize();
|
||||
static void Terminate();
|
||||
|
||||
static ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "breakpad"; }
|
||||
static const char *GetPluginDescriptionStatic() {
|
||||
return "Breakpad object file reader.";
|
||||
}
|
||||
@@ -44,9 +44,7 @@ public:
|
||||
ModuleSpecList &specs);
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
// LLVM RTTI support
|
||||
static char ID;
|
||||
|
||||
@@ -334,15 +334,6 @@ void ObjectFileELF::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
lldb_private::ConstString ObjectFileELF::GetPluginNameStatic() {
|
||||
static ConstString g_name("elf");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ObjectFileELF::GetPluginDescriptionStatic() {
|
||||
return "ELF object file reader.";
|
||||
}
|
||||
|
||||
ObjectFile *ObjectFileELF::CreateInstance(const lldb::ModuleSP &module_sp,
|
||||
DataBufferSP &data_sp,
|
||||
lldb::offset_t data_offset,
|
||||
|
||||
@@ -61,9 +61,11 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "elf"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic() {
|
||||
return "ELF object file reader.";
|
||||
}
|
||||
|
||||
static lldb_private::ObjectFile *
|
||||
CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
|
||||
@@ -85,9 +87,7 @@ public:
|
||||
lldb::addr_t length);
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
// LLVM RTTI support
|
||||
static char ID;
|
||||
|
||||
@@ -53,15 +53,6 @@ void ObjectFileJIT::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
lldb_private::ConstString ObjectFileJIT::GetPluginNameStatic() {
|
||||
static ConstString g_name("jit");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ObjectFileJIT::GetPluginDescriptionStatic() {
|
||||
return "JIT code object file";
|
||||
}
|
||||
|
||||
ObjectFile *ObjectFileJIT::CreateInstance(const lldb::ModuleSP &module_sp,
|
||||
DataBufferSP &data_sp,
|
||||
lldb::offset_t data_offset,
|
||||
|
||||
@@ -26,9 +26,11 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "jit"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic() {
|
||||
return "JIT code object file";
|
||||
}
|
||||
|
||||
static lldb_private::ObjectFile *
|
||||
CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
|
||||
@@ -96,9 +98,7 @@ public:
|
||||
ObjectFile::Strata CalculateStrata() override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
protected:
|
||||
lldb::ObjectFileJITDelegateWP m_delegate_wp;
|
||||
|
||||
@@ -833,15 +833,6 @@ void ObjectFileMachO::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
lldb_private::ConstString ObjectFileMachO::GetPluginNameStatic() {
|
||||
static ConstString g_name("mach-o");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ObjectFileMachO::GetPluginDescriptionStatic() {
|
||||
return "Mach-o object file reader (32 and 64 bit)";
|
||||
}
|
||||
|
||||
ObjectFile *ObjectFileMachO::CreateInstance(const lldb::ModuleSP &module_sp,
|
||||
DataBufferSP &data_sp,
|
||||
lldb::offset_t data_offset,
|
||||
|
||||
@@ -37,9 +37,11 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "mach-o"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic() {
|
||||
return "Mach-o object file reader (32 and 64 bit)";
|
||||
}
|
||||
|
||||
static lldb_private::ObjectFile *
|
||||
CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
|
||||
@@ -146,9 +148,7 @@ public:
|
||||
bool AllowAssemblyEmulationUnwindPlans() override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
protected:
|
||||
static lldb_private::UUID
|
||||
|
||||
@@ -32,11 +32,6 @@ void ObjectFileMinidump::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
ConstString ObjectFileMinidump::GetPluginNameStatic() {
|
||||
static ConstString g_name("minidump");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
ObjectFile *ObjectFileMinidump::CreateInstance(
|
||||
const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
|
||||
lldb::offset_t data_offset, const lldb_private::FileSpec *file,
|
||||
|
||||
@@ -29,15 +29,13 @@ public:
|
||||
static void Initialize();
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "minidump"; }
|
||||
static const char *GetPluginDescriptionStatic() {
|
||||
return "Minidump object file.";
|
||||
}
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
static lldb_private::ObjectFile *
|
||||
CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
|
||||
|
||||
@@ -46,11 +46,6 @@ void ObjectFilePDB::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
ConstString ObjectFilePDB::GetPluginNameStatic() {
|
||||
static ConstString g_name("pdb");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
ArchSpec ObjectFilePDB::GetArchitecture() {
|
||||
auto dbi_stream = m_file_up->getPDBDbiStream();
|
||||
if (!dbi_stream) {
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
static void Initialize();
|
||||
static void Terminate();
|
||||
|
||||
static ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "pdb"; }
|
||||
static const char *GetPluginDescriptionStatic() {
|
||||
return "PDB object file reader.";
|
||||
}
|
||||
@@ -48,9 +48,7 @@ public:
|
||||
ModuleSpecList &specs);
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
// LLVM RTTI support
|
||||
static char ID;
|
||||
|
||||
@@ -71,12 +71,7 @@ void ObjectFilePECOFF::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
lldb_private::ConstString ObjectFilePECOFF::GetPluginNameStatic() {
|
||||
static ConstString g_name("pe-coff");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ObjectFilePECOFF::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef ObjectFilePECOFF::GetPluginDescriptionStatic() {
|
||||
return "Portable Executable and Common Object File Format object file reader "
|
||||
"(32 and 64 bit)";
|
||||
}
|
||||
|
||||
@@ -57,9 +57,9 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "pe-coff"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static ObjectFile *
|
||||
CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
|
||||
@@ -130,9 +130,7 @@ public:
|
||||
ObjectFile::Strata CalculateStrata() override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
bool IsWindowsSubsystem();
|
||||
|
||||
|
||||
@@ -86,11 +86,6 @@ void ObjectFileWasm::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
ConstString ObjectFileWasm::GetPluginNameStatic() {
|
||||
static ConstString g_name("wasm");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
ObjectFile *
|
||||
ObjectFileWasm::CreateInstance(const ModuleSP &module_sp, DataBufferSP &data_sp,
|
||||
offset_t data_offset, const FileSpec *file,
|
||||
|
||||
@@ -24,7 +24,7 @@ public:
|
||||
static void Initialize();
|
||||
static void Terminate();
|
||||
|
||||
static ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "wasm"; }
|
||||
static const char *GetPluginDescriptionStatic() {
|
||||
return "WebAssembly object file reader.";
|
||||
}
|
||||
@@ -48,9 +48,7 @@ public:
|
||||
|
||||
/// PluginInterface protocol.
|
||||
/// \{
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
/// \}
|
||||
|
||||
/// LLVM RTTI support
|
||||
|
||||
@@ -65,12 +65,7 @@ OperatingSystem *OperatingSystemPython::CreateInstance(Process *process,
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ConstString OperatingSystemPython::GetPluginNameStatic() {
|
||||
static ConstString g_name("python");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *OperatingSystemPython::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef OperatingSystemPython::GetPluginDescriptionStatic() {
|
||||
return "Operating system plug-in that gathers OS information from a python "
|
||||
"class that implements the necessary OperatingSystem functionality.";
|
||||
}
|
||||
|
||||
@@ -36,14 +36,12 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "python"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
// lldb_private::PluginInterface Methods
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
// lldb_private::OperatingSystem Methods
|
||||
bool UpdateThreadList(lldb_private::ThreadList &old_thread_list,
|
||||
|
||||
@@ -17,10 +17,9 @@ OperatingSystem *OperatingSystem::FindPlugin(Process *process,
|
||||
const char *plugin_name) {
|
||||
OperatingSystemCreateInstance create_callback = nullptr;
|
||||
if (plugin_name) {
|
||||
ConstString const_plugin_name(plugin_name);
|
||||
create_callback =
|
||||
PluginManager::GetOperatingSystemCreateCallbackForPluginName(
|
||||
const_plugin_name);
|
||||
plugin_name);
|
||||
if (create_callback) {
|
||||
std::unique_ptr<OperatingSystem> instance_up(
|
||||
create_callback(process, true));
|
||||
|
||||
Reference in New Issue
Block a user