diff options
author | Greg Clayton <gclayton@apple.com> | 2016-06-09 23:56:12 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2016-06-09 23:56:12 +0000 |
commit | 4e26dd34a0081218acc3f825aabbfc90db67133f (patch) | |
tree | 5afde1a59b6f1886b5fa0be5c9e3de6bfae1f3cd /lldb/source/Commands/CommandObjectFrame.cpp | |
parent | 3a1398b5f0fddf87257d3b7e918f61a229c27880 (diff) | |
download | bcm5719-llvm-4e26dd34a0081218acc3f825aabbfc90db67133f.tar.gz bcm5719-llvm-4e26dd34a0081218acc3f825aabbfc90db67133f.zip |
Fix "frame variable" to show all variables defined in functions and any contained lexical blocks, even if they are static variables.
For code like:
int g_global = 234;
int g_static = 345;
int main(int argc, char **argv)
{
int a = 22333;
static int g_int = 123;
return g_global + g_static + g_int + a;
}
If we stop at the "return" statement, we expect to see "argc", "argv", "a" and "g_int" when we type "frame variable" since "g_int" is a locally defined static variable, but we don't expect to see "g_global" or "g_static" unless we add the -g option to "frame variable".
llvm-svn: 272348
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectFrame.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 18d16b3cdce..a5810085519 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -373,12 +373,10 @@ protected: Stream &s = result.GetOutputStream(); - bool get_file_globals = true; - // Be careful about the stack frame, if any summary formatter runs code, it might clear the StackFrameList // for the thread. So hold onto a shared pointer to the frame so it stays alive. - VariableList *variable_list = frame->GetVariableList (get_file_globals); + VariableList *variable_list = frame->GetVariableList (m_option_variable.show_globals); VariableSP var_sp; ValueObjectSP valobj_sp; @@ -515,13 +513,16 @@ protected: switch (var_sp->GetScope()) { case eValueTypeVariableGlobal: - dump_variable = m_option_variable.show_globals; + // Always dump globals since we only fetched them if + // m_option_variable.show_scope was true if (dump_variable && m_option_variable.show_scope) scope_string = "GLOBAL: "; break; case eValueTypeVariableStatic: - dump_variable = m_option_variable.show_globals; + // Always dump globals since we only fetched them if + // m_option_variable.show_scope was true, or this is + // a static variable from a block in the current scope if (dump_variable && m_option_variable.show_scope) scope_string = "STATIC: "; break; |