diff options
author | Pavel Labath <pavel@labath.sk> | 2021-10-15 13:07:39 +0200 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2021-10-18 10:14:42 +0200 |
commit | a3939e159fc9528b097672794035a1cdfda520e8 (patch) | |
tree | 1551cdd6d6c2d8b97bf69b04742b4b4cf0ca07d4 /lldb/source/Commands/CommandObjectPlatform.cpp | |
parent | de4d2f80b75e2a1e4b0ac5c25e20f20839633688 (diff) | |
download | llvm-a3939e159fc9528b097672794035a1cdfda520e8.zip llvm-a3939e159fc9528b097672794035a1cdfda520e8.tar.gz llvm-a3939e159fc9528b097672794035a1cdfda520e8.tar.bz2 |
[lldb] Return StringRef from PluginInterface::GetPluginName
There is no reason why this function should be returning a ConstString.
While modifying these files, I also fixed several instances where
GetPluginName and GetPluginNameStatic were returning different strings.
I am not changing the return type of GetPluginNameStatic in this patch, as that
would necessitate additional changes, and this patch is big enough as it is.
Differential Revision: https://reviews.llvm.org/D111877
Diffstat (limited to 'lldb/source/Commands/CommandObjectPlatform.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectPlatform.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp index 6bfb4c8..188d853 100644 --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -211,7 +211,7 @@ protected: ostrm.Printf("Available platforms:\n"); PlatformSP host_platform_sp(Platform::GetHostPlatform()); - ostrm.Printf("%s: %s\n", host_platform_sp->GetPluginName().GetCString(), + ostrm.Format("{0}: {1}\n", host_platform_sp->GetPluginName(), host_platform_sp->GetDescription()); uint32_t idx; @@ -346,8 +346,8 @@ protected: if (error.Success()) { Stream &ostrm = result.GetOutputStream(); if (hostname.empty()) - ostrm.Printf("Disconnected from \"%s\"\n", - platform_sp->GetPluginName().GetCString()); + ostrm.Format("Disconnected from \"{0}\"\n", + platform_sp->GetPluginName()); else ostrm.Printf("Disconnected from \"%s\"\n", hostname.c_str()); result.SetStatus(eReturnStatusSuccessFinishResult); @@ -356,9 +356,8 @@ protected: } } else { // Not connected... - result.AppendErrorWithFormat( - "not connected to '%s'", - platform_sp->GetPluginName().GetCString()); + result.AppendErrorWithFormatv("not connected to '{0}'", + platform_sp->GetPluginName()); } } else { // Bad args @@ -1289,15 +1288,14 @@ protected: if (matches == 0) { if (match_desc) - result.AppendErrorWithFormat( - "no processes were found that %s \"%s\" on the \"%s\" " + result.AppendErrorWithFormatv( + "no processes were found that {0} \"{1}\" on the \"{2}\" " "platform\n", - match_desc, match_name, - platform_sp->GetPluginName().GetCString()); + match_desc, match_name, platform_sp->GetPluginName()); else - result.AppendErrorWithFormat( - "no processes were found on the \"%s\" platform\n", - platform_sp->GetPluginName().GetCString()); + result.AppendErrorWithFormatv( + "no processes were found on the \"{0}\" platform\n", + platform_sp->GetPluginName()); } else { result.AppendMessageWithFormat( "%u matching process%s found on \"%s\"", matches, @@ -1543,9 +1541,8 @@ protected: } } else { // Not connected... - result.AppendErrorWithFormat( - "not connected to '%s'", - platform_sp->GetPluginName().GetCString()); + result.AppendErrorWithFormatv("not connected to '{0}'", + platform_sp->GetPluginName()); } } else { // No args |