[Lldb-commits] [lldb] [LLDB] Include qualified setting name in apropos search (PR #194873)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Thu Apr 30 06:37:45 PDT 2026
https://github.com/DavidSpickett updated https://github.com/llvm/llvm-project/pull/194873
>From 922556dd2c1cef726a0577aaf4e1d3245e81e7af Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at arm.com>
Date: Wed, 29 Apr 2026 13:11:32 +0000
Subject: [PATCH 1/6] refactor
---
.../Interpreter/OptionValueProperties.cpp | 39 +++++++++----------
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git a/lldb/source/Interpreter/OptionValueProperties.cpp b/lldb/source/Interpreter/OptionValueProperties.cpp
index def6cc462f76a..1908aed85fd3d 100644
--- a/lldb/source/Interpreter/OptionValueProperties.cpp
+++ b/lldb/source/Interpreter/OptionValueProperties.cpp
@@ -466,28 +466,27 @@ void OptionValueProperties::Apropos(
llvm::StringRef keyword,
std::vector<const Property *> &matching_properties) const {
const size_t num_properties = m_properties.size();
- StreamString strm;
for (size_t i = 0; i < num_properties; ++i) {
const Property *property = ProtectedGetPropertyAtIndex(i);
- if (property) {
- const OptionValueProperties *properties =
- property->GetValue()->GetAsProperties();
- if (properties) {
- properties->Apropos(keyword, matching_properties);
- } else {
- bool match = false;
- llvm::StringRef name = property->GetName();
- if (name.contains_insensitive(keyword))
- match = true;
- else {
- llvm::StringRef desc = property->GetDescription();
- if (desc.contains_insensitive(keyword))
- match = true;
- }
- if (match) {
- matching_properties.push_back(property);
- }
- }
+ if (!property)
+ continue;
+
+ if (const OptionValueProperties *properties =
+ property->GetValue()->GetAsProperties()) {
+ properties->Apropos(keyword, matching_properties);
+ continue;
+ }
+
+ if (llvm::StringRef name = property->GetName();
+ name.contains_insensitive(keyword)) {
+ matching_properties.push_back(property);
+ continue;
+ }
+
+ if (llvm::StringRef desc = property->GetDescription();
+ desc.contains_insensitive(keyword)) {
+ matching_properties.push_back(property);
+ continue;
}
}
}
>From 9d8950773d5e6b92721028877323b75e597bd07a Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at arm.com>
Date: Wed, 29 Apr 2026 12:58:14 +0000
Subject: [PATCH 2/6] wip
---
.../Interpreter/OptionValueProperties.cpp | 7 ++++++
.../API/commands/settings/TestSettings.py | 24 +++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/lldb/source/Interpreter/OptionValueProperties.cpp b/lldb/source/Interpreter/OptionValueProperties.cpp
index 1908aed85fd3d..65d913137930f 100644
--- a/lldb/source/Interpreter/OptionValueProperties.cpp
+++ b/lldb/source/Interpreter/OptionValueProperties.cpp
@@ -483,6 +483,13 @@ void OptionValueProperties::Apropos(
continue;
}
+ if (StreamString qualified_name;
+ property->DumpQualifiedName(qualified_name) &&
+ qualified_name.GetString().contains_insensitive(keyword)) {
+ matching_properties.push_back(property);
+ continue;
+ }
+
if (llvm::StringRef desc = property->GetDescription();
desc.contains_insensitive(keyword)) {
matching_properties.push_back(property);
diff --git a/lldb/test/API/commands/settings/TestSettings.py b/lldb/test/API/commands/settings/TestSettings.py
index 8410befe399a3..e3302cb9b9aa5 100644
--- a/lldb/test/API/commands/settings/TestSettings.py
+++ b/lldb/test/API/commands/settings/TestSettings.py
@@ -26,6 +26,30 @@ def test_apropos_should_also_search_settings_description(self):
],
)
+ def test_apropos_should_also_search_settings_qualified_name(self):
+ """Test that 'apropos' command searches the qualified name ("a.b.c.d") of settings not just
+ the name ("d")."""
+
+ # 'qemu-user' is one component of the qualified name.
+ self.expect(
+ "apropos 'qemu-user'",
+ substrs=[
+ "platform.plugin.qemu-user.architecture",
+ "platform.plugin.qemu-user.emulator-args",
+ ],
+ )
+
+ # Should be able to search for strings that overlap > 1 component of the
+ # qualified name.
+ self.expect(
+ "apropos 'qemu-user.emulator-'",
+ substrs=[
+ "platform.plugin.qemu-user.emulator-args",
+ "platform.plugin.qemu-user.emulator-env-vars",
+ "platform.plugin.qemu-user.emulator-path",
+ ],
+ )
+
def test_set_interpreter_repeat_prev_command(self):
"""Test the `interpreter.repeat-previous-command` setting."""
self.build()
>From 81a21838ec9d4512e4a3518919414df62fba080b Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at arm.com>
Date: Wed, 29 Apr 2026 14:09:50 +0000
Subject: [PATCH 3/6] the faster way
---
.../lldb/Interpreter/OptionValueProperties.h | 2 +
.../Interpreter/OptionValueProperties.cpp | 51 +++++++++++++++----
2 files changed, 44 insertions(+), 9 deletions(-)
diff --git a/lldb/include/lldb/Interpreter/OptionValueProperties.h b/lldb/include/lldb/Interpreter/OptionValueProperties.h
index 21da8e584a7b4..84118a06a61ff 100644
--- a/lldb/include/lldb/Interpreter/OptionValueProperties.h
+++ b/lldb/include/lldb/Interpreter/OptionValueProperties.h
@@ -84,6 +84,8 @@ class OptionValueProperties
return ProtectedGetPropertyAtIndex(idx);
}
+ size_t GetNumProperties() const { return m_properties.size(); }
+
// Property can be a property path like
// "target.process.extra-startup-command"
virtual const Property *
diff --git a/lldb/source/Interpreter/OptionValueProperties.cpp b/lldb/source/Interpreter/OptionValueProperties.cpp
index 65d913137930f..2248c7984ee55 100644
--- a/lldb/source/Interpreter/OptionValueProperties.cpp
+++ b/lldb/source/Interpreter/OptionValueProperties.cpp
@@ -462,6 +462,23 @@ void OptionValueProperties::DumpAllDescriptions(CommandInterpreter &interpreter,
}
}
+// This function flattens a nested set of properties. This is what we want for
+// search results. If we didn't do this, search results would be presented
+// split up by type of setting.
+static void
+FlattenProperties(const OptionValueProperties *properties,
+ std::vector<const Property *> &matching_properties) {
+ size_t num_child_properties = properties->GetNumProperties();
+ for (size_t i = 0; i < num_child_properties; ++i)
+ if (auto property = properties->GetPropertyAtIndex(i)) {
+ if (auto children = property->GetValue()->GetAsProperties()) {
+ FlattenProperties(children, matching_properties);
+ } else {
+ matching_properties.push_back(property);
+ }
+ }
+}
+
void OptionValueProperties::Apropos(
llvm::StringRef keyword,
std::vector<const Property *> &matching_properties) const {
@@ -471,21 +488,37 @@ void OptionValueProperties::Apropos(
if (!property)
continue;
+ // The qualified name includes the category parts. For example
+ // "platform.plugin.qemu-user.qemu-user".
+ StreamString qualified_name_strm;
+ std::optional<llvm::StringRef> qualified_name_str;
+ if (property->DumpQualifiedName(qualified_name_strm))
+ qualified_name_str = qualified_name_strm.GetString();
+
+ // Some properties are a group of other priorities.
if (const OptionValueProperties *properties =
property->GetValue()->GetAsProperties()) {
- properties->Apropos(keyword, matching_properties);
- continue;
- }
+ // If the keyword is already in the qualified name, any nested
+ // settings would match too and we can just add them, skipping
+ // getting their qualified names too.
+ if (qualified_name_str &&
+ qualified_name_str->contains_insensitive(keyword)) {
+ FlattenProperties(properties, matching_properties);
+ } else {
+ // Search in all the nested settings.
+ properties->Apropos(keyword, matching_properties);
+ }
- if (llvm::StringRef name = property->GetName();
- name.contains_insensitive(keyword)) {
- matching_properties.push_back(property);
continue;
}
- if (StreamString qualified_name;
- property->DumpQualifiedName(qualified_name) &&
- qualified_name.GetString().contains_insensitive(keyword)) {
+ if (qualified_name_str) {
+ if (qualified_name_str->contains_insensitive(keyword)) {
+ matching_properties.push_back(property);
+ continue;
+ }
+ } else if (llvm::StringRef name = property->GetName();
+ name.contains_insensitive(keyword)) {
matching_properties.push_back(property);
continue;
}
>From 6bde5987bb2eefede2f3fc833630c424f87b73be Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at arm.com>
Date: Thu, 30 Apr 2026 12:06:35 +0000
Subject: [PATCH 4/6] Revert " the faster way"
This reverts commit 81a21838ec9d4512e4a3518919414df62fba080b.
---
.../lldb/Interpreter/OptionValueProperties.h | 2 -
.../Interpreter/OptionValueProperties.cpp | 51 ++++---------------
2 files changed, 9 insertions(+), 44 deletions(-)
diff --git a/lldb/include/lldb/Interpreter/OptionValueProperties.h b/lldb/include/lldb/Interpreter/OptionValueProperties.h
index 84118a06a61ff..21da8e584a7b4 100644
--- a/lldb/include/lldb/Interpreter/OptionValueProperties.h
+++ b/lldb/include/lldb/Interpreter/OptionValueProperties.h
@@ -84,8 +84,6 @@ class OptionValueProperties
return ProtectedGetPropertyAtIndex(idx);
}
- size_t GetNumProperties() const { return m_properties.size(); }
-
// Property can be a property path like
// "target.process.extra-startup-command"
virtual const Property *
diff --git a/lldb/source/Interpreter/OptionValueProperties.cpp b/lldb/source/Interpreter/OptionValueProperties.cpp
index 2248c7984ee55..65d913137930f 100644
--- a/lldb/source/Interpreter/OptionValueProperties.cpp
+++ b/lldb/source/Interpreter/OptionValueProperties.cpp
@@ -462,23 +462,6 @@ void OptionValueProperties::DumpAllDescriptions(CommandInterpreter &interpreter,
}
}
-// This function flattens a nested set of properties. This is what we want for
-// search results. If we didn't do this, search results would be presented
-// split up by type of setting.
-static void
-FlattenProperties(const OptionValueProperties *properties,
- std::vector<const Property *> &matching_properties) {
- size_t num_child_properties = properties->GetNumProperties();
- for (size_t i = 0; i < num_child_properties; ++i)
- if (auto property = properties->GetPropertyAtIndex(i)) {
- if (auto children = property->GetValue()->GetAsProperties()) {
- FlattenProperties(children, matching_properties);
- } else {
- matching_properties.push_back(property);
- }
- }
-}
-
void OptionValueProperties::Apropos(
llvm::StringRef keyword,
std::vector<const Property *> &matching_properties) const {
@@ -488,37 +471,21 @@ void OptionValueProperties::Apropos(
if (!property)
continue;
- // The qualified name includes the category parts. For example
- // "platform.plugin.qemu-user.qemu-user".
- StreamString qualified_name_strm;
- std::optional<llvm::StringRef> qualified_name_str;
- if (property->DumpQualifiedName(qualified_name_strm))
- qualified_name_str = qualified_name_strm.GetString();
-
- // Some properties are a group of other priorities.
if (const OptionValueProperties *properties =
property->GetValue()->GetAsProperties()) {
- // If the keyword is already in the qualified name, any nested
- // settings would match too and we can just add them, skipping
- // getting their qualified names too.
- if (qualified_name_str &&
- qualified_name_str->contains_insensitive(keyword)) {
- FlattenProperties(properties, matching_properties);
- } else {
- // Search in all the nested settings.
- properties->Apropos(keyword, matching_properties);
- }
+ properties->Apropos(keyword, matching_properties);
+ continue;
+ }
+ if (llvm::StringRef name = property->GetName();
+ name.contains_insensitive(keyword)) {
+ matching_properties.push_back(property);
continue;
}
- if (qualified_name_str) {
- if (qualified_name_str->contains_insensitive(keyword)) {
- matching_properties.push_back(property);
- continue;
- }
- } else if (llvm::StringRef name = property->GetName();
- name.contains_insensitive(keyword)) {
+ if (StreamString qualified_name;
+ property->DumpQualifiedName(qualified_name) &&
+ qualified_name.GetString().contains_insensitive(keyword)) {
matching_properties.push_back(property);
continue;
}
>From c844987af5ab12d9b148249c9e334d8ccd0f8805 Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at arm.com>
Date: Thu, 30 Apr 2026 12:06:44 +0000
Subject: [PATCH 5/6] get property and property nodes into 2 lists
---
.../lldb/Core/UserSettingsController.h | 5 ++-
.../lldb/Interpreter/OptionValueProperties.h | 3 +-
lldb/source/Commands/CommandObjectApropos.cpp | 8 ++--
lldb/source/Core/UserSettingsController.cpp | 10 ++---
.../Interpreter/OptionValueProperties.cpp | 42 +++++++++++--------
5 files changed, 38 insertions(+), 30 deletions(-)
diff --git a/lldb/include/lldb/Core/UserSettingsController.h b/lldb/include/lldb/Core/UserSettingsController.h
index 29e892fdba45b..a1ba2d32915c8 100644
--- a/lldb/include/lldb/Core/UserSettingsController.h
+++ b/lldb/include/lldb/Core/UserSettingsController.h
@@ -62,8 +62,9 @@ class Properties {
virtual void DumpAllDescriptions(CommandInterpreter &interpreter,
Stream &strm) const;
- size_t Apropos(llvm::StringRef keyword,
- std::vector<const Property *> &matching_properties) const;
+ void Apropos(llvm::StringRef keyword,
+ std::vector<const Property *> &matching_properties,
+ std::vector<const Property *> &matching_property_prefixes) const;
// We sometimes need to introduce a setting to enable experimental features,
// but then we don't want the setting for these to cause errors when the
diff --git a/lldb/include/lldb/Interpreter/OptionValueProperties.h b/lldb/include/lldb/Interpreter/OptionValueProperties.h
index 21da8e584a7b4..d9f74c802c433 100644
--- a/lldb/include/lldb/Interpreter/OptionValueProperties.h
+++ b/lldb/include/lldb/Interpreter/OptionValueProperties.h
@@ -58,7 +58,8 @@ class OptionValueProperties
Stream &strm) const;
void Apropos(llvm::StringRef keyword,
- std::vector<const Property *> &matching_properties) const;
+ std::vector<const Property *> &matching_properties,
+ std::vector<const Property *> &matching_property_prefixes) const;
void Initialize(const PropertyCollectionDefinition &setting_definitions);
diff --git a/lldb/source/Commands/CommandObjectApropos.cpp b/lldb/source/Commands/CommandObjectApropos.cpp
index 7c2d3068f68d7..37fe24cf80a5c 100644
--- a/lldb/source/Commands/CommandObjectApropos.cpp
+++ b/lldb/source/Commands/CommandObjectApropos.cpp
@@ -61,8 +61,8 @@ void CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
// Find all the properties matching the search word.
size_t properties_max_len = 0;
std::vector<const Property *> properties;
- const size_t num_properties =
- GetDebugger().Apropos(search_word, properties);
+ std::vector<const Property *> property_prefixes;
+ GetDebugger().Apropos(search_word, properties, property_prefixes);
for (const Property *prop : properties) {
StreamString qualified_name;
prop->DumpQualifiedName(qualified_name);
@@ -70,7 +70,7 @@ void CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
std::max(properties_max_len, qualified_name.GetString().size());
}
- if (num_properties == 0) {
+ if (properties.size() == 0) {
result.AppendMessageWithFormatv(
"No settings found pertaining to '{0}'. "
"Try 'settings show' to see a complete list of "
@@ -83,7 +83,7 @@ void CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
search_word);
const bool dump_qualified_name = true;
- for (size_t i = 0; i < num_properties; ++i)
+ for (size_t i = 0; i < properties.size(); ++i)
properties[i]->DumpDescription(
m_interpreter, result.GetOutputStream(), properties_max_len,
dump_qualified_name);
diff --git a/lldb/source/Core/UserSettingsController.cpp b/lldb/source/Core/UserSettingsController.cpp
index 206b2072ddaf2..c7c33b947d1ab 100644
--- a/lldb/source/Core/UserSettingsController.cpp
+++ b/lldb/source/Core/UserSettingsController.cpp
@@ -75,11 +75,11 @@ Status Properties::DumpPropertyValue(const ExecutionContext *exe_ctx,
dump_mask, is_json);
}
-size_t
-Properties::Apropos(llvm::StringRef keyword,
- std::vector<const Property *> &matching_properties) const {
- m_collection_sp->Apropos(keyword, matching_properties);
- return matching_properties.size();
+void Properties::Apropos(
+ llvm::StringRef keyword, std::vector<const Property *> &matching_properties,
+ std::vector<const Property *> &matching_property_prefixes) const {
+ m_collection_sp->Apropos(keyword, matching_properties,
+ matching_property_prefixes);
}
llvm::StringRef Properties::GetExperimentalSettingsName() {
diff --git a/lldb/source/Interpreter/OptionValueProperties.cpp b/lldb/source/Interpreter/OptionValueProperties.cpp
index 65d913137930f..df3f2218284f2 100644
--- a/lldb/source/Interpreter/OptionValueProperties.cpp
+++ b/lldb/source/Interpreter/OptionValueProperties.cpp
@@ -463,37 +463,43 @@ void OptionValueProperties::DumpAllDescriptions(CommandInterpreter &interpreter,
}
void OptionValueProperties::Apropos(
- llvm::StringRef keyword,
- std::vector<const Property *> &matching_properties) const {
+ llvm::StringRef keyword, std::vector<const Property *> &matching_properties,
+ std::vector<const Property *> &matching_property_prefixes) const {
const size_t num_properties = m_properties.size();
for (size_t i = 0; i < num_properties; ++i) {
const Property *property = ProtectedGetPropertyAtIndex(i);
if (!property)
continue;
- if (const OptionValueProperties *properties =
- property->GetValue()->GetAsProperties()) {
- properties->Apropos(keyword, matching_properties);
- continue;
- }
+ const OptionValueProperties *properties =
+ property->GetValue()->GetAsProperties();
+ if (properties)
+ properties->Apropos(keyword, matching_properties,
+ matching_property_prefixes);
- if (llvm::StringRef name = property->GetName();
- name.contains_insensitive(keyword)) {
- matching_properties.push_back(property);
- continue;
- }
+ bool matched = false;
+ // TODO: do we need this at all? It allows you to look for a.b?
if (StreamString qualified_name;
property->DumpQualifiedName(qualified_name) &&
- qualified_name.GetString().contains_insensitive(keyword)) {
- matching_properties.push_back(property);
- continue;
- }
+ qualified_name.GetString().contains_insensitive(keyword))
+ matched = true;
+
+ if (llvm::StringRef name = property->GetName();
+ !matched && name.contains_insensitive(keyword))
+ matched = true;
if (llvm::StringRef desc = property->GetDescription();
- desc.contains_insensitive(keyword)) {
- matching_properties.push_back(property);
+ !matched && desc.contains_insensitive(keyword))
+ matched = true;
+
+ if (!matched)
continue;
+
+ if (properties) {
+ matching_property_prefixes.push_back(property);
+ } else {
+ matching_properties.push_back(property);
}
}
}
>From 1ed79a04a61a863f4435d738a71c5323b077ca5d Mon Sep 17 00:00:00 2001
From: David Spickett <david.spickett at arm.com>
Date: Thu, 30 Apr 2026 13:09:32 +0000
Subject: [PATCH 6/6] print property prefixes
---
lldb/source/Commands/CommandObjectApropos.cpp | 43 ++++++++++++++-----
.../Interpreter/OptionValueProperties.cpp | 6 ---
lldb/source/Interpreter/Property.cpp | 10 +++--
.../API/commands/settings/TestSettings.py | 22 +++-------
4 files changed, 44 insertions(+), 37 deletions(-)
diff --git a/lldb/source/Commands/CommandObjectApropos.cpp b/lldb/source/Commands/CommandObjectApropos.cpp
index 37fe24cf80a5c..7fb07f2c736d7 100644
--- a/lldb/source/Commands/CommandObjectApropos.cpp
+++ b/lldb/source/Commands/CommandObjectApropos.cpp
@@ -70,7 +70,7 @@ void CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
std::max(properties_max_len, qualified_name.GetString().size());
}
- if (properties.size() == 0) {
+ if (properties.empty() && property_prefixes.empty()) {
result.AppendMessageWithFormatv(
"No settings found pertaining to '{0}'. "
"Try 'settings show' to see a complete list of "
@@ -78,18 +78,39 @@ void CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
args[0].c_str());
} else {
- result.AppendMessageWithFormatv(
- "\nThe following settings variables may relate to '{0}': \n\n",
- search_word);
-
- const bool dump_qualified_name = true;
- for (size_t i = 0; i < properties.size(); ++i)
- properties[i]->DumpDescription(
- m_interpreter, result.GetOutputStream(), properties_max_len,
- dump_qualified_name);
return_status = eReturnStatusSuccessFinishResult;
- }
+ if (!property_prefixes.empty()) {
+ result.AppendMessageWithFormatv(
+ "\nThe following settings prefixes may relate to '{0}': \n\n",
+ search_word);
+
+ auto &out_strm = result.GetOutputStream();
+ out_strm.IndentMore();
+ for (auto prefix : property_prefixes) {
+ StreamString qual_name_strm;
+ if (prefix->DumpQualifiedName(qual_name_strm)) {
+ result.GetOutputStream().Indent();
+ result.GetOutputStream() << qual_name_strm.GetString() << '\n';
+ }
+ }
+ out_strm.IndentLess();
+
+ result.AppendMessageWithFormatv(
+ "\n(use 'settings list' to show settings with a given prefix)");
+ }
+
+ if (!properties.empty()) {
+ result.AppendMessageWithFormatv(
+ "\nThe following settings variables may relate to '{0}': \n\n",
+ search_word);
+
+ const bool dump_qualified_name = true;
+ for (auto property : properties)
+ property->DumpDescription(m_interpreter, result.GetOutputStream(),
+ properties_max_len, dump_qualified_name);
+ }
+ }
result.SetStatus(return_status);
} else {
result.AppendError("'' is not a valid search word.\n");
diff --git a/lldb/source/Interpreter/OptionValueProperties.cpp b/lldb/source/Interpreter/OptionValueProperties.cpp
index df3f2218284f2..3b0cdd453b0bc 100644
--- a/lldb/source/Interpreter/OptionValueProperties.cpp
+++ b/lldb/source/Interpreter/OptionValueProperties.cpp
@@ -479,12 +479,6 @@ void OptionValueProperties::Apropos(
bool matched = false;
- // TODO: do we need this at all? It allows you to look for a.b?
- if (StreamString qualified_name;
- property->DumpQualifiedName(qualified_name) &&
- qualified_name.GetString().contains_insensitive(keyword))
- matched = true;
-
if (llvm::StringRef name = property->GetName();
!matched && name.contains_insensitive(keyword))
matched = true;
diff --git a/lldb/source/Interpreter/Property.cpp b/lldb/source/Interpreter/Property.cpp
index 56e45363be89a..74ac0f4bba0f6 100644
--- a/lldb/source/Interpreter/Property.cpp
+++ b/lldb/source/Interpreter/Property.cpp
@@ -236,9 +236,13 @@ Property::Property(llvm::StringRef name, llvm::StringRef desc, bool is_global,
bool Property::DumpQualifiedName(Stream &strm) const {
if (!m_name.empty()) {
- if (m_value_sp->DumpQualifiedName(strm))
- strm.PutChar('.');
- strm << m_name;
+ bool has_sub_properties = static_cast<bool>(m_value_sp->GetAsProperties());
+ bool dumped_something = m_value_sp->DumpQualifiedName(strm);
+ if (!has_sub_properties) {
+ if (dumped_something)
+ strm.PutChar('.');
+ strm << m_name;
+ }
return true;
}
return false;
diff --git a/lldb/test/API/commands/settings/TestSettings.py b/lldb/test/API/commands/settings/TestSettings.py
index e3302cb9b9aa5..5035a3f23632d 100644
--- a/lldb/test/API/commands/settings/TestSettings.py
+++ b/lldb/test/API/commands/settings/TestSettings.py
@@ -26,27 +26,15 @@ def test_apropos_should_also_search_settings_description(self):
],
)
- def test_apropos_should_also_search_settings_qualified_name(self):
- """Test that 'apropos' command searches the qualified name ("a.b.c.d") of settings not just
- the name ("d")."""
+ def test_apropos_searches_settings_prefixes(self):
+ """Test that 'apropos' command searches the prefixes of the qualified names."""
- # 'qemu-user' is one component of the qualified name.
self.expect(
"apropos 'qemu-user'",
substrs=[
- "platform.plugin.qemu-user.architecture",
- "platform.plugin.qemu-user.emulator-args",
- ],
- )
-
- # Should be able to search for strings that overlap > 1 component of the
- # qualified name.
- self.expect(
- "apropos 'qemu-user.emulator-'",
- substrs=[
- "platform.plugin.qemu-user.emulator-args",
- "platform.plugin.qemu-user.emulator-env-vars",
- "platform.plugin.qemu-user.emulator-path",
+ "The following settings prefixes may relate to 'qemu-user':\n"
+ " platform.plugin.qemu-user\n"
+ "\n"
],
)
More information about the lldb-commits
mailing list