summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2018-04-27 01:57:40 +0000
committerJim Ingham <jingham@apple.com>2018-04-27 01:57:40 +0000
commit93979f67f8cc49f596ae34c45699371bd3cda785 (patch)
tree2a298483c366405f82f0556d779830e381b4e8b9 /lldb/source/Target
parent1ae1febfde7e6860bb199132859f46909b87593c (diff)
downloadbcm5719-llvm-93979f67f8cc49f596ae34c45699371bd3cda785.tar.gz
bcm5719-llvm-93979f67f8cc49f596ae34c45699371bd3cda785.zip
Fix a thinko in the iteration over StructuredDataPlugin Create functions.
The code was grabbing the first plugin, and then never getting another one. <rdar://problem/39779438> llvm-svn: 331012
Diffstat (limited to 'lldb/source/Target')
-rw-r--r--lldb/source/Target/Process.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index 7486480d47c..2b16afd5811 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -6177,11 +6177,16 @@ void Process::MapSupportedStructuredDataPlugins(
// For each StructuredDataPlugin, if the plugin handles any of the
// types in the supported_type_names, map that type name to that plugin.
- uint32_t plugin_index = 0;
- for (auto create_instance =
+ // Stop when we've consumed all the type names.
+ // FIXME: should we return an error if there are type names nobody
+ // supports?
+ for (uint32_t plugin_index = 0; !const_type_names.empty(); plugin_index++) {
+ auto create_instance =
PluginManager::GetStructuredDataPluginCreateCallbackAtIndex(
plugin_index);
- create_instance && !const_type_names.empty(); ++plugin_index) {
+ if (!create_instance)
+ break;
+
// Create the plugin.
StructuredDataPluginSP plugin_sp = (*create_instance)(*this);
if (!plugin_sp) {
OpenPOWER on IntegriCloud