forked from OSchip/llvm-project
[lldb] Remove ConstString from Process, ScriptInterpreter and StructuredData plugin names
This commit is contained in:
parent
21adcdb712
commit
5f4980f004
|
@ -230,7 +230,7 @@ public:
|
|||
CompletionRequest &request);
|
||||
// Process
|
||||
static bool
|
||||
RegisterPlugin(ConstString name, const char *description,
|
||||
RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
|
||||
ProcessCreateInstance create_callback,
|
||||
DebuggerInitializeCallback debugger_init_callback = nullptr);
|
||||
|
||||
|
@ -239,17 +239,17 @@ public:
|
|||
static ProcessCreateInstance GetProcessCreateCallbackAtIndex(uint32_t idx);
|
||||
|
||||
static ProcessCreateInstance
|
||||
GetProcessCreateCallbackForPluginName(ConstString name);
|
||||
GetProcessCreateCallbackForPluginName(llvm::StringRef name);
|
||||
|
||||
static const char *GetProcessPluginNameAtIndex(uint32_t idx);
|
||||
static llvm::StringRef GetProcessPluginNameAtIndex(uint32_t idx);
|
||||
|
||||
static const char *GetProcessPluginDescriptionAtIndex(uint32_t idx);
|
||||
static llvm::StringRef GetProcessPluginDescriptionAtIndex(uint32_t idx);
|
||||
|
||||
static void AutoCompleteProcessName(llvm::StringRef partial_name,
|
||||
CompletionRequest &request);
|
||||
|
||||
// ScriptInterpreter
|
||||
static bool RegisterPlugin(ConstString name, const char *description,
|
||||
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
|
||||
lldb::ScriptLanguage script_lang,
|
||||
ScriptInterpreterCreateInstance create_callback);
|
||||
|
||||
|
@ -297,7 +297,7 @@ public:
|
|||
/// \return
|
||||
/// Returns true upon success; otherwise, false.
|
||||
static bool
|
||||
RegisterPlugin(ConstString name, const char *description,
|
||||
RegisterPlugin(llvm::StringRef name, llvm::StringRef description,
|
||||
StructuredDataPluginCreateInstance create_callback,
|
||||
DebuggerInitializeCallback debugger_init_callback = nullptr,
|
||||
StructuredDataFilterLaunchInfo filter_callback = nullptr);
|
||||
|
|
|
@ -23,9 +23,9 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "trace"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
ProcessTrace(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp);
|
||||
|
||||
|
@ -40,9 +40,7 @@ public:
|
|||
|
||||
SystemRuntime *GetSystemRuntime() override { return nullptr; }
|
||||
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
Status DoDestroy() override;
|
||||
|
||||
|
|
|
@ -1665,8 +1665,9 @@ public:
|
|||
names.push_back("<default>");
|
||||
|
||||
size_t i = 0;
|
||||
while (auto name = PluginManager::GetProcessPluginNameAtIndex(i++))
|
||||
names.push_back(name);
|
||||
for (llvm::StringRef name = PluginManager::GetProcessPluginNameAtIndex(i++);
|
||||
!name.empty(); name = PluginManager::GetProcessPluginNameAtIndex(i++))
|
||||
names.push_back(name.str());
|
||||
return names;
|
||||
}
|
||||
|
||||
|
|
|
@ -830,22 +830,23 @@ static ProcessInstances &GetProcessInstances() {
|
|||
}
|
||||
|
||||
bool PluginManager::RegisterPlugin(
|
||||
ConstString name, const char *description,
|
||||
llvm::StringRef name, llvm::StringRef description,
|
||||
ProcessCreateInstance create_callback,
|
||||
DebuggerInitializeCallback debugger_init_callback) {
|
||||
return GetProcessInstances().RegisterPlugin(
|
||||
name, description, create_callback, debugger_init_callback);
|
||||
ConstString(name), description.str().c_str(), create_callback,
|
||||
debugger_init_callback);
|
||||
}
|
||||
|
||||
bool PluginManager::UnregisterPlugin(ProcessCreateInstance create_callback) {
|
||||
return GetProcessInstances().UnregisterPlugin(create_callback);
|
||||
}
|
||||
|
||||
const char *PluginManager::GetProcessPluginNameAtIndex(uint32_t idx) {
|
||||
llvm::StringRef PluginManager::GetProcessPluginNameAtIndex(uint32_t idx) {
|
||||
return GetProcessInstances().GetNameAtIndex(idx);
|
||||
}
|
||||
|
||||
const char *PluginManager::GetProcessPluginDescriptionAtIndex(uint32_t idx) {
|
||||
llvm::StringRef PluginManager::GetProcessPluginDescriptionAtIndex(uint32_t idx) {
|
||||
return GetProcessInstances().GetDescriptionAtIndex(idx);
|
||||
}
|
||||
|
||||
|
@ -855,8 +856,8 @@ PluginManager::GetProcessCreateCallbackAtIndex(uint32_t idx) {
|
|||
}
|
||||
|
||||
ProcessCreateInstance
|
||||
PluginManager::GetProcessCreateCallbackForPluginName(ConstString name) {
|
||||
return GetProcessInstances().GetCallbackForName(name);
|
||||
PluginManager::GetProcessCreateCallbackForPluginName(llvm::StringRef name) {
|
||||
return GetProcessInstances().GetCallbackForName(ConstString(name));
|
||||
}
|
||||
|
||||
void PluginManager::AutoCompleteProcessName(llvm::StringRef name,
|
||||
|
@ -889,11 +890,12 @@ static ScriptInterpreterInstances &GetScriptInterpreterInstances() {
|
|||
}
|
||||
|
||||
bool PluginManager::RegisterPlugin(
|
||||
ConstString name, const char *description,
|
||||
llvm::StringRef name, llvm::StringRef description,
|
||||
lldb::ScriptLanguage script_language,
|
||||
ScriptInterpreterCreateInstance create_callback) {
|
||||
return GetScriptInterpreterInstances().RegisterPlugin(
|
||||
name, description, create_callback, script_language);
|
||||
ConstString(name), description.str().c_str(), create_callback,
|
||||
script_language);
|
||||
}
|
||||
|
||||
bool PluginManager::UnregisterPlugin(
|
||||
|
@ -949,13 +951,13 @@ static StructuredDataPluginInstances &GetStructuredDataPluginInstances() {
|
|||
}
|
||||
|
||||
bool PluginManager::RegisterPlugin(
|
||||
ConstString name, const char *description,
|
||||
llvm::StringRef name, llvm::StringRef description,
|
||||
StructuredDataPluginCreateInstance create_callback,
|
||||
DebuggerInitializeCallback debugger_init_callback,
|
||||
StructuredDataFilterLaunchInfo filter_callback) {
|
||||
return GetStructuredDataPluginInstances().RegisterPlugin(
|
||||
name, description, create_callback, debugger_init_callback,
|
||||
filter_callback);
|
||||
ConstString(name), description.str().c_str(), create_callback,
|
||||
debugger_init_callback, filter_callback);
|
||||
}
|
||||
|
||||
bool PluginManager::UnregisterPlugin(
|
||||
|
|
|
@ -65,7 +65,7 @@ enum {
|
|||
class PluginProperties : public Properties {
|
||||
public:
|
||||
static ConstString GetSettingName() {
|
||||
return ProcessKDP::GetPluginNameStatic();
|
||||
return ConstString(ProcessKDP::GetPluginNameStatic());
|
||||
}
|
||||
|
||||
PluginProperties() : Properties() {
|
||||
|
@ -91,12 +91,7 @@ static PluginProperties &GetGlobalPluginProperties() {
|
|||
|
||||
static const lldb::tid_t g_kernel_tid = 1;
|
||||
|
||||
ConstString ProcessKDP::GetPluginNameStatic() {
|
||||
static ConstString g_name("kdp-remote");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ProcessKDP::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef ProcessKDP::GetPluginDescriptionStatic() {
|
||||
return "KDP Remote protocol based debugging plug-in for darwin kernel "
|
||||
"debugging.";
|
||||
}
|
||||
|
|
|
@ -41,9 +41,9 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "kdp-remote"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
// Constructors and Destructors
|
||||
ProcessKDP(lldb::TargetSP target_sp, lldb::ListenerSP listener);
|
||||
|
@ -85,9 +85,7 @@ public:
|
|||
lldb_private::DynamicLoader *GetDynamicLoader() override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
// Process Control
|
||||
lldb_private::Status WillResume() override;
|
||||
|
|
|
@ -106,12 +106,7 @@ void ProcessWindows::Initialize() {
|
|||
|
||||
void ProcessWindows::Terminate() {}
|
||||
|
||||
lldb_private::ConstString ProcessWindows::GetPluginNameStatic() {
|
||||
static ConstString g_name("windows");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ProcessWindows::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef ProcessWindows::GetPluginDescriptionStatic() {
|
||||
return "Process plugin for Windows";
|
||||
}
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "windows"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
// Constructors and destructors
|
||||
ProcessWindows(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp);
|
||||
|
@ -45,9 +45,7 @@ public:
|
|||
size_t GetSTDERR(char *buf, size_t buf_size, Status &error) override;
|
||||
size_t PutSTDIN(const char *buf, size_t buf_size, Status &error) override;
|
||||
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
Status EnableBreakpointSite(BreakpointSite *bp_site) override;
|
||||
Status DisableBreakpointSite(BreakpointSite *bp_site) override;
|
||||
|
|
|
@ -37,12 +37,7 @@ namespace ELF = llvm::ELF;
|
|||
|
||||
LLDB_PLUGIN_DEFINE(ProcessElfCore)
|
||||
|
||||
ConstString ProcessElfCore::GetPluginNameStatic() {
|
||||
static ConstString g_name("elf-core");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ProcessElfCore::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef ProcessElfCore::GetPluginDescriptionStatic() {
|
||||
return "ELF core dump plug-in.";
|
||||
}
|
||||
|
||||
|
|
|
@ -40,9 +40,9 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "elf-core"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
// Constructors and Destructors
|
||||
ProcessElfCore(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
|
||||
|
@ -60,9 +60,7 @@ public:
|
|||
lldb_private::DynamicLoader *GetDynamicLoader() override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
// Process Control
|
||||
lldb_private::Status DoDestroy() override;
|
||||
|
|
|
@ -126,7 +126,7 @@ enum {
|
|||
class PluginProperties : public Properties {
|
||||
public:
|
||||
static ConstString GetSettingName() {
|
||||
return ProcessGDBRemote::GetPluginNameStatic();
|
||||
return ConstString(ProcessGDBRemote::GetPluginNameStatic());
|
||||
}
|
||||
|
||||
PluginProperties() : Properties() {
|
||||
|
@ -184,12 +184,7 @@ static PluginProperties &GetGlobalPluginProperties() {
|
|||
#define HIGH_PORT (49151u)
|
||||
#endif
|
||||
|
||||
ConstString ProcessGDBRemote::GetPluginNameStatic() {
|
||||
static ConstString g_name("gdb-remote");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ProcessGDBRemote::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef ProcessGDBRemote::GetPluginDescriptionStatic() {
|
||||
return "GDB Remote protocol based debugging plug-in.";
|
||||
}
|
||||
|
||||
|
|
|
@ -65,9 +65,9 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "gdb-remote"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static std::chrono::seconds GetPacketTimeout();
|
||||
|
||||
|
@ -103,9 +103,7 @@ public:
|
|||
void DidAttach(ArchSpec &process_arch) override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
// Process Control
|
||||
Status WillResume() override;
|
||||
|
|
|
@ -48,12 +48,7 @@ using namespace lldb_private;
|
|||
|
||||
LLDB_PLUGIN_DEFINE(ProcessMachCore)
|
||||
|
||||
ConstString ProcessMachCore::GetPluginNameStatic() {
|
||||
static ConstString g_name("mach-o-core");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ProcessMachCore::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef ProcessMachCore::GetPluginDescriptionStatic() {
|
||||
return "Mach-O core file debugging plug-in.";
|
||||
}
|
||||
|
||||
|
|
|
@ -35,9 +35,9 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "mach-o-core"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
// Check if a given Process
|
||||
bool CanDebug(lldb::TargetSP target_sp,
|
||||
|
@ -49,9 +49,7 @@ public:
|
|||
lldb_private::DynamicLoader *GetDynamicLoader() override;
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
// Process Control
|
||||
lldb_private::Status DoDestroy() override;
|
||||
|
|
|
@ -190,12 +190,7 @@ void HashElfTextSection(ModuleSP module_sp, std::vector<uint8_t> &breakpad_uuid,
|
|||
|
||||
} // namespace
|
||||
|
||||
ConstString ProcessMinidump::GetPluginNameStatic() {
|
||||
static ConstString g_name("minidump");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ProcessMinidump::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef ProcessMinidump::GetPluginDescriptionStatic() {
|
||||
return "Minidump plug-in.";
|
||||
}
|
||||
|
||||
|
|
|
@ -37,9 +37,9 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "minidump"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
ProcessMinidump(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
|
||||
const FileSpec &core_file, lldb::DataBufferSP code_data);
|
||||
|
@ -55,9 +55,7 @@ public:
|
|||
|
||||
DynamicLoader *GetDynamicLoader() override { return nullptr; }
|
||||
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
SystemRuntime *GetSystemRuntime() override { return nullptr; }
|
||||
|
||||
|
|
|
@ -30,12 +30,7 @@ LLDB_PLUGIN_DEFINE(ScriptedProcess)
|
|||
using namespace lldb;
|
||||
using namespace lldb_private;
|
||||
|
||||
ConstString ScriptedProcess::GetPluginNameStatic() {
|
||||
static ConstString g_name("ScriptedProcess");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ScriptedProcess::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef ScriptedProcess::GetPluginDescriptionStatic() {
|
||||
return "Scripted Process plug-in.";
|
||||
}
|
||||
|
||||
|
|
|
@ -48,9 +48,9 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "ScriptedProcess"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
ScriptedProcess(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
|
||||
const ScriptedProcess::ScriptedProcessInfo &launch_info,
|
||||
|
@ -63,9 +63,7 @@ public:
|
|||
|
||||
DynamicLoader *GetDynamicLoader() override { return nullptr; }
|
||||
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
SystemRuntime *GetSystemRuntime() override { return nullptr; }
|
||||
|
||||
|
|
|
@ -387,12 +387,7 @@ ScriptInterpreterLua::CreateInstance(Debugger &debugger) {
|
|||
return std::make_shared<ScriptInterpreterLua>(debugger);
|
||||
}
|
||||
|
||||
lldb_private::ConstString ScriptInterpreterLua::GetPluginNameStatic() {
|
||||
static ConstString g_name("script-lua");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ScriptInterpreterLua::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef ScriptInterpreterLua::GetPluginDescriptionStatic() {
|
||||
return "Lua script interpreter";
|
||||
}
|
||||
|
||||
|
|
|
@ -56,9 +56,9 @@ public:
|
|||
|
||||
static lldb::ScriptInterpreterSP CreateInstance(Debugger &debugger);
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "script-lua"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
static bool BreakpointCallbackFunction(void *baton,
|
||||
StoppointCallbackContext *context,
|
||||
|
@ -70,9 +70,7 @@ public:
|
|||
lldb::user_id_t watch_id);
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
Lua &GetLua();
|
||||
|
||||
|
|
|
@ -57,11 +57,6 @@ ScriptInterpreterNone::CreateInstance(Debugger &debugger) {
|
|||
return std::make_shared<ScriptInterpreterNone>(debugger);
|
||||
}
|
||||
|
||||
lldb_private::ConstString ScriptInterpreterNone::GetPluginNameStatic() {
|
||||
static ConstString g_name("script-none");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ScriptInterpreterNone::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef ScriptInterpreterNone::GetPluginDescriptionStatic() {
|
||||
return "Null script interpreter";
|
||||
}
|
||||
|
|
|
@ -32,14 +32,12 @@ public:
|
|||
|
||||
static lldb::ScriptInterpreterSP CreateInstance(Debugger &debugger);
|
||||
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "script-none"; }
|
||||
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
};
|
||||
|
||||
} // namespace lldb_private
|
||||
|
|
|
@ -436,12 +436,7 @@ void ScriptInterpreterPython::SharedLibraryDirectoryHelper(
|
|||
#endif
|
||||
}
|
||||
|
||||
lldb_private::ConstString ScriptInterpreterPython::GetPluginNameStatic() {
|
||||
static ConstString g_name("script-python");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ScriptInterpreterPython::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef ScriptInterpreterPython::GetPluginDescriptionStatic() {
|
||||
return "Embedded Python interpreter";
|
||||
}
|
||||
|
||||
|
|
|
@ -48,8 +48,8 @@ public:
|
|||
|
||||
static void Initialize();
|
||||
static void Terminate();
|
||||
static lldb_private::ConstString GetPluginNameStatic();
|
||||
static const char *GetPluginDescriptionStatic();
|
||||
static llvm::StringRef GetPluginNameStatic() { return "script-python"; }
|
||||
static llvm::StringRef GetPluginDescriptionStatic();
|
||||
static FileSpec GetPythonDir();
|
||||
static void SharedLibraryDirectoryHelper(FileSpec &this_file);
|
||||
|
||||
|
|
|
@ -292,9 +292,7 @@ public:
|
|||
static lldb::ScriptInterpreterSP CreateInstance(Debugger &debugger);
|
||||
|
||||
// PluginInterface protocol
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetPluginNameStatic().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetPluginNameStatic(); }
|
||||
|
||||
class Locker : public ScriptInterpreterLocker {
|
||||
public:
|
||||
|
|
|
@ -800,9 +800,8 @@ protected:
|
|||
// Get the plugin for the process.
|
||||
auto plugin_sp =
|
||||
process_sp->GetStructuredDataPlugin(GetDarwinLogTypeName());
|
||||
if (!plugin_sp ||
|
||||
(plugin_sp->GetPluginName() !=
|
||||
StructuredDataDarwinLog::GetStaticPluginName().GetStringRef())) {
|
||||
if (!plugin_sp || (plugin_sp->GetPluginName() !=
|
||||
StructuredDataDarwinLog::GetStaticPluginName())) {
|
||||
result.AppendError("failed to get StructuredDataPlugin for "
|
||||
"the process");
|
||||
}
|
||||
|
@ -875,9 +874,9 @@ protected:
|
|||
process_sp->GetStructuredDataPlugin(GetDarwinLogTypeName());
|
||||
stream.Printf("Availability: %s\n",
|
||||
plugin_sp ? "available" : "unavailable");
|
||||
ConstString plugin_name = StructuredDataDarwinLog::GetStaticPluginName();
|
||||
llvm::StringRef plugin_name = StructuredDataDarwinLog::GetStaticPluginName();
|
||||
const bool enabled =
|
||||
plugin_sp ? plugin_sp->GetEnabled(plugin_name) : false;
|
||||
plugin_sp ? plugin_sp->GetEnabled(ConstString(plugin_name)) : false;
|
||||
stream.Printf("Enabled: %s\n", enabled ? "true" : "false");
|
||||
}
|
||||
|
||||
|
@ -1050,11 +1049,6 @@ void StructuredDataDarwinLog::Terminate() {
|
|||
PluginManager::UnregisterPlugin(&CreateInstance);
|
||||
}
|
||||
|
||||
ConstString StructuredDataDarwinLog::GetStaticPluginName() {
|
||||
static ConstString s_plugin_name("darwin-log");
|
||||
return s_plugin_name;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
#pragma mark StructuredDataPlugin API
|
||||
|
||||
|
@ -1205,7 +1199,7 @@ Status StructuredDataDarwinLog::GetDescription(
|
|||
}
|
||||
|
||||
bool StructuredDataDarwinLog::GetEnabled(ConstString type_name) const {
|
||||
if (type_name == GetStaticPluginName())
|
||||
if (type_name.GetStringRef() == GetStaticPluginName())
|
||||
return m_is_enabled;
|
||||
else
|
||||
return false;
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
|
||||
static void Terminate();
|
||||
|
||||
static ConstString GetStaticPluginName();
|
||||
static llvm::StringRef GetStaticPluginName() { return "darwin-log"; }
|
||||
|
||||
/// Return whether the DarwinLog functionality is enabled.
|
||||
///
|
||||
|
@ -46,9 +46,7 @@ public:
|
|||
|
||||
// PluginInterface API
|
||||
|
||||
llvm::StringRef GetPluginName() override {
|
||||
return GetStaticPluginName().GetStringRef();
|
||||
}
|
||||
llvm::StringRef GetPluginName() override { return GetStaticPluginName(); }
|
||||
|
||||
// StructuredDataPlugin API
|
||||
|
||||
|
|
|
@ -363,9 +363,8 @@ ProcessSP Process::FindPlugin(lldb::TargetSP target_sp,
|
|||
ProcessSP process_sp;
|
||||
ProcessCreateInstance create_callback = nullptr;
|
||||
if (!plugin_name.empty()) {
|
||||
ConstString const_plugin_name(plugin_name);
|
||||
create_callback =
|
||||
PluginManager::GetProcessCreateCallbackForPluginName(const_plugin_name);
|
||||
PluginManager::GetProcessCreateCallbackForPluginName(plugin_name);
|
||||
if (create_callback) {
|
||||
process_sp = create_callback(target_sp, listener_sp, crash_file_path,
|
||||
can_connect);
|
||||
|
|
|
@ -19,12 +19,7 @@
|
|||
using namespace lldb;
|
||||
using namespace lldb_private;
|
||||
|
||||
ConstString ProcessTrace::GetPluginNameStatic() {
|
||||
static ConstString g_name("trace");
|
||||
return g_name;
|
||||
}
|
||||
|
||||
const char *ProcessTrace::GetPluginDescriptionStatic() {
|
||||
llvm::StringRef ProcessTrace::GetPluginDescriptionStatic() {
|
||||
return "Trace process plug-in.";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue