Remove ConstString from DynamicLoader, JITLoader and Instruction plugin names
This commit is contained in:
@@ -84,7 +84,7 @@ public:
|
||||
|
||||
// DynamicLoader
|
||||
static bool
|
||||
RegisterPlugin(ConstString name, const char *description,
|
||||
RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
|
||||
DynamicLoaderCreateInstance create_callback,
|
||||
DebuggerInitializeCallback debugger_init_callback = nullptr);
|
||||
|
||||
@@ -94,11 +94,11 @@ public:
|
||||
GetDynamicLoaderCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static DynamicLoaderCreateInstance
|
||||
GetDynamicLoaderCreateCallbackForPluginName(ConstString name);
|
||||
GetDynamicLoaderCreateCallbackForPluginName(llvm::StringRef name);
|
||||
|
||||
// JITLoader
|
||||
static bool
|
||||
RegisterPlugin(ConstString name, const char *description,
|
||||
RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
|
||||
JITLoaderCreateInstance create_callback,
|
||||
DebuggerInitializeCallback debugger_init_callback = nullptr);
|
||||
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
GetJITLoaderCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
// EmulateInstruction
|
||||
static bool RegisterPlugin(ConstString name, const char *description,
|
||||
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
|
||||
EmulateInstructionCreateInstance create_callback);
|
||||
|
||||
static bool
|
||||
@@ -118,7 +118,7 @@ public:
|
||||
GetEmulateInstructionCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static EmulateInstructionCreateInstance
|
||||
GetEmulateInstructionCreateCallbackForPluginName(ConstString name);
|
||||
GetEmulateInstructionCreateCallbackForPluginName(llvm::StringRef name);
|
||||
|
||||
// OperatingSystem
|
||||
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
|
||||
|
||||
@@ -62,8 +62,9 @@ public:
|
||||
///
|
||||
/// \param[in] plugin_name
|
||||
/// An optional name of a specific dynamic loader plug-in that
|
||||
/// should be used. If NULL, pick the best plug-in.
|
||||
static DynamicLoader *FindPlugin(Process *process, const char *plugin_name);
|
||||
/// should be used. If empty, pick the best plug-in.
|
||||
static DynamicLoader *FindPlugin(Process *process,
|
||||
llvm::StringRef plugin_name);
|
||||
|
||||
/// Construct with a process.
|
||||
DynamicLoader(Process *process);
|
||||
|
||||
@@ -30,13 +30,11 @@ using namespace lldb;
|
||||
using namespace lldb_private;
|
||||
|
||||
DynamicLoader *DynamicLoader::FindPlugin(Process *process,
|
||||
const char *plugin_name) {
|
||||
llvm::StringRef plugin_name) {
|
||||
DynamicLoaderCreateInstance create_callback = nullptr;
|
||||
if (plugin_name) {
|
||||
ConstString const_plugin_name(plugin_name);
|
||||
if (!plugin_name.empty()) {
|
||||
create_callback =
|
||||
PluginManager::GetDynamicLoaderCreateCallbackForPluginName(
|
||||
const_plugin_name);
|
||||
PluginManager::GetDynamicLoaderCreateCallbackForPluginName(plugin_name);
|
||||
if (create_callback) {
|
||||
std::unique_ptr<DynamicLoader> instance_up(
|
||||
create_callback(process, true));
|
||||
|
||||
@@ -46,10 +46,9 @@ EmulateInstruction::FindPlugin(const ArchSpec &arch,
|
||||
const char *plugin_name) {
|
||||
EmulateInstructionCreateInstance create_callback = nullptr;
|
||||
if (plugin_name) {
|
||||
ConstString const_plugin_name(plugin_name);
|
||||
create_callback =
|
||||
PluginManager::GetEmulateInstructionCreateCallbackForPluginName(
|
||||
const_plugin_name);
|
||||
plugin_name);
|
||||
if (create_callback) {
|
||||
EmulateInstruction *emulate_insn_ptr =
|
||||
create_callback(arch, supported_inst_type);
|
||||
|
||||
@@ -383,11 +383,12 @@ static DynamicLoaderInstances &GetDynamicLoaderInstances() {
|
||||
}
|
||||
|
||||
bool PluginManager::RegisterPlugin(
|
||||
ConstString name, const char *description,
|
||||
llvm::StringRef name, llvm::StringRef description,
|
||||
DynamicLoaderCreateInstance create_callback,
|
||||
DebuggerInitializeCallback debugger_init_callback) {
|
||||
return GetDynamicLoaderInstances().RegisterPlugin(
|
||||
name, description, create_callback, debugger_init_callback);
|
||||
ConstString(name), description.str().c_str(), create_callback,
|
||||
debugger_init_callback);
|
||||
}
|
||||
|
||||
bool PluginManager::UnregisterPlugin(
|
||||
@@ -401,8 +402,9 @@ PluginManager::GetDynamicLoaderCreateCallbackAtIndex(uint32_t idx) {
|
||||
}
|
||||
|
||||
DynamicLoaderCreateInstance
|
||||
PluginManager::GetDynamicLoaderCreateCallbackForPluginName(ConstString name) {
|
||||
return GetDynamicLoaderInstances().GetCallbackForName(name);
|
||||
PluginManager::GetDynamicLoaderCreateCallbackForPluginName(
|
||||
llvm::StringRef name) {
|
||||
return GetDynamicLoaderInstances().GetCallbackForName(ConstString(name));
|
||||
}
|
||||
|
||||
#pragma mark JITLoader
|
||||
@@ -416,11 +418,12 @@ static JITLoaderInstances &GetJITLoaderInstances() {
|
||||
}
|
||||
|
||||
bool PluginManager::RegisterPlugin(
|
||||
ConstString name, const char *description,
|
||||
llvm::StringRef name, llvm::StringRef description,
|
||||
JITLoaderCreateInstance create_callback,
|
||||
DebuggerInitializeCallback debugger_init_callback) {
|
||||
return GetJITLoaderInstances().RegisterPlugin(
|
||||
name, description, create_callback, debugger_init_callback);
|
||||
ConstString(name), description.str().c_str(), create_callback,
|
||||
debugger_init_callback);
|
||||
}
|
||||
|
||||
bool PluginManager::UnregisterPlugin(JITLoaderCreateInstance create_callback) {
|
||||
@@ -444,10 +447,10 @@ static EmulateInstructionInstances &GetEmulateInstructionInstances() {
|
||||
}
|
||||
|
||||
bool PluginManager::RegisterPlugin(
|
||||
ConstString name, const char *description,
|
||||
llvm::StringRef name, llvm::StringRef description,
|
||||
EmulateInstructionCreateInstance create_callback) {
|
||||
return GetEmulateInstructionInstances().RegisterPlugin(name, description,
|
||||
create_callback);
|
||||
return GetEmulateInstructionInstances().RegisterPlugin(
|
||||
ConstString(name), description.str().c_str(), create_callback);
|
||||
}
|
||||
|
||||
bool PluginManager::UnregisterPlugin(
|
||||
@@ -462,8 +465,8 @@ PluginManager::GetEmulateInstructionCreateCallbackAtIndex(uint32_t idx) {
|
||||
|
||||
EmulateInstructionCreateInstance
|
||||
PluginManager::GetEmulateInstructionCreateCallbackForPluginName(
|
||||
ConstString name) {
|
||||
return GetEmulateInstructionInstances().GetCallbackForName(name);
|
||||
llvm::StringRef name) {
|
||||
return GetEmulateInstructionInstances().GetCallbackForName(ConstString(name));
|
||||
}
|
||||
|
||||
#pragma mark OperatingSystem
|
||||
|
||||
@@ -1548,12 +1548,7 @@ void DynamicLoaderDarwinKernel::DebuggerInitialize(
|
||||
}
|
||||
}
|
||||
|
||||
lldb_private::ConstString DynamicLoaderDarwinKernel::GetPluginNameStatic() {
|
||||
static ConstString g_name("darwin-kernel");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *DynamicLoaderDarwinKernel::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef DynamicLoaderDarwinKernel::GetPluginDescriptionStatic() {
|
||||
return "Dynamic loader plug-in that watches for shared library loads/unloads "
|
||||
"in the MacOSX kernel.";
|
||||
}
|
||||
|
||||
@@ -33,9 +33,9 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "darwin-kernel"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static lldb_private::DynamicLoader *
|
||||
CreateInstance(lldb_private::Process *process, bool force);
|
||||
@@ -58,9 +58,7 @@ public:
|
||||
lldb_private::Status CanLoadImage() override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
protected:
|
||||
void PrivateInitialize(lldb_private::Process *process);
|
||||
|
||||
@@ -78,12 +78,7 @@ void DynamicLoaderHexagonDYLD::Initialize() {
|
||||
|
||||
void DynamicLoaderHexagonDYLD::Terminate() {}
|
||||
|
||||
lldb_private::ConstString DynamicLoaderHexagonDYLD::GetPluginNameStatic() {
|
||||
static ConstString g_name("hexagon-dyld");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *DynamicLoaderHexagonDYLD::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef DynamicLoaderHexagonDYLD::GetPluginDescriptionStatic() {
|
||||
return "Dynamic loader plug-in that watches for shared library "
|
||||
"loads/unloads in Hexagon processes.";
|
||||
}
|
||||
|
||||
@@ -24,9 +24,9 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "hexagon-dyld"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static lldb_private::DynamicLoader *
|
||||
CreateInstance(lldb_private::Process *process, bool force);
|
||||
@@ -47,9 +47,7 @@ public:
|
||||
lldb::addr_t tls_file_addr) override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
protected:
|
||||
/// Runtime linker rendezvous structure.
|
||||
|
||||
@@ -504,12 +504,7 @@ void DynamicLoaderMacOS::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
lldb_private::ConstString DynamicLoaderMacOS::GetPluginNameStatic() {
|
||||
static ConstString g_name("macos-dyld");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *DynamicLoaderMacOS::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef DynamicLoaderMacOS::GetPluginDescriptionStatic() {
|
||||
return "Dynamic loader plug-in that watches for shared library loads/unloads "
|
||||
"in MacOSX user processes.";
|
||||
}
|
||||
|
||||
@@ -39,9 +39,9 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "macos-dyld"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static lldb_private::DynamicLoader *
|
||||
CreateInstance(lldb_private::Process *process, bool force);
|
||||
@@ -60,9 +60,7 @@ public:
|
||||
lldb_private::LazyBool &private_shared_cache) override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
protected:
|
||||
void PutToLog(lldb_private::Log *log) const;
|
||||
|
||||
@@ -1136,12 +1136,7 @@ void DynamicLoaderMacOSXDYLD::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
lldb_private::ConstString DynamicLoaderMacOSXDYLD::GetPluginNameStatic() {
|
||||
static ConstString g_name("macosx-dyld");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *DynamicLoaderMacOSXDYLD::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef DynamicLoaderMacOSXDYLD::GetPluginDescriptionStatic() {
|
||||
return "Dynamic loader plug-in that watches for shared library loads/unloads "
|
||||
"in MacOSX user processes.";
|
||||
}
|
||||
|
||||
@@ -43,9 +43,9 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "macosx-dyld"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static lldb_private::DynamicLoader *
|
||||
CreateInstance(lldb_private::Process *process, bool force);
|
||||
@@ -64,9 +64,7 @@ public:
|
||||
lldb_private::LazyBool &private_shared_cache) override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
bool IsFullyInitialized() override;
|
||||
|
||||
|
||||
@@ -38,12 +38,7 @@ void DynamicLoaderPOSIXDYLD::Initialize() {
|
||||
|
||||
void DynamicLoaderPOSIXDYLD::Terminate() {}
|
||||
|
||||
lldb_private::ConstString DynamicLoaderPOSIXDYLD::GetPluginNameStatic() {
|
||||
static ConstString g_name("linux-dyld");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *DynamicLoaderPOSIXDYLD::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef DynamicLoaderPOSIXDYLD::GetPluginDescriptionStatic() {
|
||||
return "Dynamic loader plug-in that watches for shared library "
|
||||
"loads/unloads in POSIX processes.";
|
||||
}
|
||||
|
||||
@@ -30,9 +30,9 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "posix-dyld"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static lldb_private::DynamicLoader *
|
||||
CreateInstance(lldb_private::Process *process, bool force);
|
||||
@@ -53,9 +53,7 @@ public:
|
||||
lldb::addr_t tls_file_addr) override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
protected:
|
||||
/// Runtime linker rendezvous structure.
|
||||
|
||||
@@ -152,12 +152,7 @@ void DynamicLoaderStatic::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
lldb_private::ConstString DynamicLoaderStatic::GetPluginNameStatic() {
|
||||
static ConstString g_name("static");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *DynamicLoaderStatic::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef DynamicLoaderStatic::GetPluginDescriptionStatic() {
|
||||
return "Dynamic loader plug-in that will load any images at the static "
|
||||
"addresses contained in each image.";
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "static"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static lldb_private::DynamicLoader *
|
||||
CreateInstance(lldb_private::Process *process, bool force);
|
||||
@@ -44,9 +44,7 @@ public:
|
||||
lldb_private::Status CanLoadImage() override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
private:
|
||||
void LoadAllImagesAtFileAddresses();
|
||||
|
||||
@@ -37,12 +37,7 @@ void DynamicLoaderWindowsDYLD::Initialize() {
|
||||
|
||||
void DynamicLoaderWindowsDYLD::Terminate() {}
|
||||
|
||||
ConstString DynamicLoaderWindowsDYLD::GetPluginNameStatic() {
|
||||
static ConstString g_plugin_name("windows-dyld");
|
||||
return g_plugin_name;
|
||||
}
|
||||
|
||||
const char *DynamicLoaderWindowsDYLD::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef DynamicLoaderWindowsDYLD::GetPluginDescriptionStatic() {
|
||||
return "Dynamic loader plug-in that watches for shared library "
|
||||
"loads/unloads in Windows processes.";
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@ public:
|
||||
|
||||
static void Initialize();
|
||||
static void Terminate();
|
||||
static ConstString GetPluginNameStatic();
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "windows-dyld"; }
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static DynamicLoader *CreateInstance(Process *process, bool force);
|
||||
|
||||
@@ -39,9 +39,7 @@ public:
|
||||
lldb::ThreadPlanSP GetStepThroughTrampolinePlan(Thread &thread,
|
||||
bool stop) override;
|
||||
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
protected:
|
||||
lldb::addr_t GetLoadAddress(lldb::ModuleSP executable);
|
||||
|
||||
@@ -30,12 +30,7 @@ void DynamicLoaderWasmDYLD::Initialize() {
|
||||
GetPluginDescriptionStatic(), CreateInstance);
|
||||
}
|
||||
|
||||
ConstString DynamicLoaderWasmDYLD::GetPluginNameStatic() {
|
||||
static ConstString g_plugin_name("wasm-dyld");
|
||||
return g_plugin_name;
|
||||
}
|
||||
|
||||
const char *DynamicLoaderWasmDYLD::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef DynamicLoaderWasmDYLD::GetPluginDescriptionStatic() {
|
||||
return "Dynamic loader plug-in that watches for shared library "
|
||||
"loads/unloads in WebAssembly engines.";
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ public:
|
||||
static void Initialize();
|
||||
static void Terminate() {}
|
||||
|
||||
static ConstString GetPluginNameStatic();
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "wasm-dyld"; }
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static DynamicLoader *CreateInstance(Process *process, bool force);
|
||||
|
||||
@@ -37,9 +37,7 @@ public:
|
||||
|
||||
/// PluginInterface protocol.
|
||||
/// \{
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
/// \}
|
||||
};
|
||||
|
||||
|
||||
@@ -713,12 +713,7 @@ void EmulateInstructionARM::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
ConstString EmulateInstructionARM::GetPluginNameStatic() {
|
||||
static ConstString g_name("arm");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *EmulateInstructionARM::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef EmulateInstructionARM::GetPluginDescriptionStatic() {
|
||||
return "Emulate instructions for the ARM architecture.";
|
||||
}
|
||||
|
||||
|
||||
@@ -62,9 +62,9 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "arm"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static lldb_private::EmulateInstruction *
|
||||
CreateInstance(const lldb_private::ArchSpec &arch, InstructionType inst_type);
|
||||
@@ -83,9 +83,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
bool SetTargetTriple(const ArchSpec &arch) override;
|
||||
|
||||
|
||||
@@ -117,12 +117,7 @@ void EmulateInstructionARM64::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
ConstString EmulateInstructionARM64::GetPluginNameStatic() {
|
||||
ConstString g_plugin_name("lldb.emulate-instruction.arm64");
|
||||
return g_plugin_name;
|
||||
}
|
||||
|
||||
const char *EmulateInstructionARM64::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef EmulateInstructionARM64::GetPluginDescriptionStatic() {
|
||||
return "Emulate instructions for the ARM64 architecture.";
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "arm64"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static lldb_private::EmulateInstruction *
|
||||
CreateInstance(const lldb_private::ArchSpec &arch,
|
||||
@@ -46,9 +46,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
bool SetTargetTriple(const lldb_private::ArchSpec &arch) override;
|
||||
|
||||
|
||||
@@ -193,12 +193,7 @@ void EmulateInstructionMIPS::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
ConstString EmulateInstructionMIPS::GetPluginNameStatic() {
|
||||
ConstString g_plugin_name("lldb.emulate-instruction.mips32");
|
||||
return g_plugin_name;
|
||||
}
|
||||
|
||||
const char *EmulateInstructionMIPS::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef EmulateInstructionMIPS::GetPluginDescriptionStatic() {
|
||||
return "Emulate instructions for the MIPS32 architecture.";
|
||||
}
|
||||
|
||||
|
||||
@@ -33,9 +33,9 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "mips32"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static lldb_private::EmulateInstruction *
|
||||
CreateInstance(const lldb_private::ArchSpec &arch,
|
||||
@@ -55,9 +55,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
bool SetTargetTriple(const lldb_private::ArchSpec &arch) override;
|
||||
|
||||
|
||||
@@ -180,12 +180,7 @@ void EmulateInstructionMIPS64::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
ConstString EmulateInstructionMIPS64::GetPluginNameStatic() {
|
||||
ConstString g_plugin_name("lldb.emulate-instruction.mips64");
|
||||
return g_plugin_name;
|
||||
}
|
||||
|
||||
const char *EmulateInstructionMIPS64::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef EmulateInstructionMIPS64::GetPluginDescriptionStatic() {
|
||||
return "Emulate instructions for the MIPS64 architecture.";
|
||||
}
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "mips64"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static lldb_private::EmulateInstruction *
|
||||
CreateInstance(const lldb_private::ArchSpec &arch,
|
||||
@@ -53,9 +53,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
bool SetTargetTriple(const lldb_private::ArchSpec &arch) override;
|
||||
|
||||
|
||||
@@ -39,12 +39,7 @@ void EmulateInstructionPPC64::Terminate() {
|
||||
PluginManager::UnregisterPlugin(CreateInstance);
|
||||
}
|
||||
|
||||
ConstString EmulateInstructionPPC64::GetPluginNameStatic() {
|
||||
ConstString g_plugin_name("lldb.emulate-instruction.ppc64");
|
||||
return g_plugin_name;
|
||||
}
|
||||
|
||||
const char *EmulateInstructionPPC64::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef EmulateInstructionPPC64::GetPluginDescriptionStatic() {
|
||||
return "Emulate instructions for the PPC64 architecture.";
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,9 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "ppc64"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static EmulateInstruction *CreateInstance(const ArchSpec &arch,
|
||||
InstructionType inst_type);
|
||||
@@ -44,9 +44,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
bool SetTargetTriple(const ArchSpec &arch) override;
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ enum {
|
||||
class PluginProperties : public Properties {
|
||||
public:
|
||||
static ConstString GetSettingName() {
|
||||
return JITLoaderGDB::GetPluginNameStatic();
|
||||
return ConstString(JITLoaderGDB::GetPluginNameStatic());
|
||||
}
|
||||
|
||||
PluginProperties() {
|
||||
@@ -402,11 +402,6 @@ bool JITLoaderGDB::ReadJITDescriptorImpl(bool all_entries) {
|
||||
}
|
||||
|
||||
// PluginInterface protocol
|
||||
lldb_private::ConstString JITLoaderGDB::GetPluginNameStatic() {
|
||||
static ConstString g_name("gdb");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
JITLoaderSP JITLoaderGDB::CreateInstance(Process *process, bool force) {
|
||||
JITLoaderSP jit_loader_sp;
|
||||
bool enable;
|
||||
@@ -427,7 +422,7 @@ JITLoaderSP JITLoaderGDB::CreateInstance(Process *process, bool force) {
|
||||
return jit_loader_sp;
|
||||
}
|
||||
|
||||
const char *JITLoaderGDB::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef JITLoaderGDB::GetPluginDescriptionStatic() {
|
||||
return "JIT loader plug-in that watches for JIT events using the GDB "
|
||||
"interface.";
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ public:
|
||||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "gdb"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static lldb::JITLoaderSP CreateInstance(lldb_private::Process *process,
|
||||
bool force);
|
||||
@@ -35,9 +35,7 @@ public:
|
||||
static void DebuggerInitialize(lldb_private::Debugger &debugger);
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
// JITLoader interface
|
||||
void DidAttach() override;
|
||||
|
||||
@@ -150,8 +150,8 @@ ProcessKDP::ProcessKDP(TargetSP target_sp, ListenerSP listener_sp)
|
||||
: Process(target_sp, listener_sp),
|
||||
m_comm("lldb.process.kdp-remote.communication"),
|
||||
m_async_broadcaster(NULL, "lldb.process.kdp-remote.async-broadcaster"),
|
||||
m_dyld_plugin_name(), m_kernel_load_addr(LLDB_INVALID_ADDRESS),
|
||||
m_command_sp(), m_kernel_thread_wp() {
|
||||
m_kernel_load_addr(LLDB_INVALID_ADDRESS), m_command_sp(),
|
||||
m_kernel_thread_wp() {
|
||||
m_async_broadcaster.SetEventName(eBroadcastBitAsyncThreadShouldExit,
|
||||
"async thread should exit");
|
||||
m_async_broadcaster.SetEventName(eBroadcastBitAsyncContinue,
|
||||
@@ -268,8 +268,7 @@ Status ProcessKDP::DoConnectRemote(llvm::StringRef remote_url) {
|
||||
// Select an invalid plugin name for the dynamic loader so one
|
||||
// doesn't get used since EFI does its own manual loading via
|
||||
// python scripting
|
||||
static ConstString g_none_dynamic_loader("none");
|
||||
m_dyld_plugin_name = g_none_dynamic_loader;
|
||||
m_dyld_plugin_name = "none";
|
||||
|
||||
if (kernel_uuid.IsValid()) {
|
||||
// If EFI passed in a UUID= try to lookup UUID The slide will not
|
||||
@@ -398,9 +397,7 @@ addr_t ProcessKDP::GetImageInfoAddress() { return m_kernel_load_addr; }
|
||||
|
||||
lldb_private::DynamicLoader *ProcessKDP::GetDynamicLoader() {
|
||||
if (m_dyld_up.get() == NULL)
|
||||
m_dyld_up.reset(DynamicLoader::FindPlugin(
|
||||
this,
|
||||
m_dyld_plugin_name.IsEmpty() ? NULL : m_dyld_plugin_name.GetCString()));
|
||||
m_dyld_up.reset(DynamicLoader::FindPlugin(this, m_dyld_plugin_name));
|
||||
return m_dyld_up.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ protected:
|
||||
CommunicationKDP m_comm;
|
||||
lldb_private::Broadcaster m_async_broadcaster;
|
||||
lldb_private::HostThread m_async_thread;
|
||||
lldb_private::ConstString m_dyld_plugin_name;
|
||||
llvm::StringRef m_dyld_plugin_name;
|
||||
lldb::addr_t m_kernel_load_addr;
|
||||
lldb::CommandObjectSP m_command_sp;
|
||||
lldb::ThreadWP m_kernel_thread_wp;
|
||||
|
||||
@@ -252,7 +252,7 @@ Status ProcessElfCore::DoLoadCore() {
|
||||
lldb_private::DynamicLoader *ProcessElfCore::GetDynamicLoader() {
|
||||
if (m_dyld_up.get() == nullptr)
|
||||
m_dyld_up.reset(DynamicLoader::FindPlugin(
|
||||
this, DynamicLoaderPOSIXDYLD::GetPluginNameStatic().GetCString()));
|
||||
this, DynamicLoaderPOSIXDYLD::GetPluginNameStatic()));
|
||||
return m_dyld_up.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -3891,7 +3891,7 @@ bool ProcessGDBRemote::StopNoticingNewThreads() {
|
||||
|
||||
DynamicLoader *ProcessGDBRemote::GetDynamicLoader() {
|
||||
if (m_dyld_up.get() == nullptr)
|
||||
m_dyld_up.reset(DynamicLoader::FindPlugin(this, nullptr));
|
||||
m_dyld_up.reset(DynamicLoader::FindPlugin(this, ""));
|
||||
return m_dyld_up.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -116,7 +116,7 @@ ProcessMachCore::ProcessMachCore(lldb::TargetSP target_sp,
|
||||
: PostMortemProcess(target_sp, listener_sp), m_core_aranges(),
|
||||
m_core_range_infos(), m_core_module_sp(), m_core_file(core_file),
|
||||
m_dyld_addr(LLDB_INVALID_ADDRESS),
|
||||
m_mach_kernel_addr(LLDB_INVALID_ADDRESS), m_dyld_plugin_name() {}
|
||||
m_mach_kernel_addr(LLDB_INVALID_ADDRESS) {}
|
||||
|
||||
// Destructor
|
||||
ProcessMachCore::~ProcessMachCore() {
|
||||
@@ -468,7 +468,7 @@ Status ProcessMachCore::DoLoadCore() {
|
||||
}
|
||||
}
|
||||
|
||||
if (m_dyld_plugin_name.IsEmpty()) {
|
||||
if (m_dyld_plugin_name.empty()) {
|
||||
// If we found both a user-process dyld and a kernel binary, we need to
|
||||
// decide which to prefer.
|
||||
if (GetCorefilePreference() == eKernelCorefile) {
|
||||
@@ -538,9 +538,7 @@ Status ProcessMachCore::DoLoadCore() {
|
||||
|
||||
lldb_private::DynamicLoader *ProcessMachCore::GetDynamicLoader() {
|
||||
if (m_dyld_up.get() == nullptr)
|
||||
m_dyld_up.reset(DynamicLoader::FindPlugin(
|
||||
this, m_dyld_plugin_name.IsEmpty() ? nullptr
|
||||
: m_dyld_plugin_name.GetCString()));
|
||||
m_dyld_up.reset(DynamicLoader::FindPlugin(this, m_dyld_plugin_name));
|
||||
return m_dyld_up.get();
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ private:
|
||||
lldb_private::FileSpec m_core_file;
|
||||
lldb::addr_t m_dyld_addr;
|
||||
lldb::addr_t m_mach_kernel_addr;
|
||||
lldb_private::ConstString m_dyld_plugin_name;
|
||||
llvm::StringRef m_dyld_plugin_name;
|
||||
};
|
||||
|
||||
#endif // LLDB_SOURCE_PLUGINS_PROCESS_MACH_CORE_PROCESSMACHCORE_H
|
||||
|
||||
@@ -2656,7 +2656,7 @@ Status Process::LoadCore() {
|
||||
|
||||
DynamicLoader *Process::GetDynamicLoader() {
|
||||
if (!m_dyld_up)
|
||||
m_dyld_up.reset(DynamicLoader::FindPlugin(this, nullptr));
|
||||
m_dyld_up.reset(DynamicLoader::FindPlugin(this, ""));
|
||||
return m_dyld_up.get();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user