diff options
author | Greg Clayton <gclayton@apple.com> | 2016-04-29 21:00:38 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2016-04-29 21:00:38 +0000 |
commit | 349213f941015f9932fa6dcc323e4ff93051dd77 (patch) | |
tree | 73f63c1e47203f7ff3f536563e336f327d3ce27d /lldb/source/API/SBFrame.cpp | |
parent | d744e63d903ea0bbf6a4d7a80be019fb908a571f (diff) | |
download | bcm5719-llvm-349213f941015f9932fa6dcc323e4ff93051dd77.tar.gz bcm5719-llvm-349213f941015f9932fa6dcc323e4ff93051dd77.zip |
Fix TestGetVariables.py so it works correctly. We had duplicate static values showing up as we would find static variables in the Block and also in the compile unit. We now make sure a variable hasn't been added to the list before we add it.
llvm-svn: 268101
Diffstat (limited to 'lldb/source/API/SBFrame.cpp')
-rw-r--r-- | lldb/source/API/SBFrame.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp index cdf5a5a2a76..5c491eb4e22 100644 --- a/lldb/source/API/SBFrame.cpp +++ b/lldb/source/API/SBFrame.cpp @@ -10,6 +10,7 @@ // C Includes // C++ Includes #include <algorithm> +#include <set> #include <string> // Other libraries and framework includes @@ -1142,7 +1143,8 @@ SBFrame::GetVariables (const lldb::SBVariablesOptions& options) arguments, locals, statics, in_scope_only, include_runtime_support_values, use_dynamic); - + + std::set<VariableSP> variable_set; Process *process = exe_ctx.GetProcessPtr(); if (target && process) { @@ -1186,6 +1188,12 @@ SBFrame::GetVariables (const lldb::SBVariablesOptions& options) } if (add_variable) { + // Only add variables once so we don't end up with duplicates + if (variable_set.find(variable_sp) == variable_set.end()) + variable_set.insert(variable_sp); + else + continue; + if (in_scope_only && !variable_sp->IsInScope(frame)) continue; |