[Lldb-commits] [lldb] [lldb] add plugin names to process save-core error output. (PR #143126)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Fri Jun 6 08:24:44 PDT 2025
================
@@ -22,8 +22,26 @@ Status SaveCoreOptions::SetPluginName(const char *name) {
}
if (!PluginManager::IsRegisteredObjectFilePluginName(name)) {
- return Status::FromErrorStringWithFormat(
- "plugin name '%s' is not a valid ObjectFile plugin name", name);
+ StreamString stream;
+ stream.Printf("plugin name '%s' is not a valid ObjectFile plugin name.",
+ name);
+
+ llvm::SmallVector<llvm::StringRef> plugin_names =
+ PluginManager::GetSaveCorePluginNames();
+ if (!plugin_names.empty()) {
+ stream.PutCString(" valid values are: ");
+ bool is_first = true;
+ for (llvm::StringRef plugin_name : plugin_names) {
+ llvm::StringRef delimiter = ", ";
+ if (is_first) {
----------------
DavidSpickett wrote:
There is an llvm::join somewhere in ADT, that will handle first and last for you. Just have to accumulate it into a std::string to print it which is fine, we don't care about one extra copy here.
Look in llvm/include/llvm/ADT/StringExtras.h.
https://github.com/llvm/llvm-project/pull/143126
More information about the lldb-commits
mailing list