aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectFrame.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2015-09-30 23:12:22 +0000
committerEnrico Granata <egranata@apple.com>2015-09-30 23:12:22 +0000
commit6754e04f6d9474c918371982e4c88d987adc9ff4 (patch)
treea5fce8bb9166e79da25bc5e03f51e308a3eba156 /lldb/source/Commands/CommandObjectFrame.cpp
parent6dec87a8a08b715a63347f595ecab0318b6564ea (diff)
downloadllvm-6754e04f6d9474c918371982e4c88d987adc9ff4.zip
llvm-6754e04f6d9474c918371982e4c88d987adc9ff4.tar.gz
llvm-6754e04f6d9474c918371982e4c88d987adc9ff4.tar.bz2
Introudce a IsTopLevelFunction() API on Language and Function
This is meant to support languages that have a scripting mode with top-level code that acts as global For now, this flag only controls whether 'frame variable' will attempt to treat globals as locals when within such a function llvm-svn: 248960
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 8e5145a..f638243 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -35,6 +35,7 @@
#include "lldb/Interpreter/OptionGroupVariable.h"
#include "lldb/Symbol/CompilerType.h"
#include "lldb/Symbol/ClangASTContext.h"
+#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/Type.h"
@@ -409,6 +410,10 @@ protected:
DumpValueObjectOptions options(m_varobj_options.GetAsDumpOptions(eLanguageRuntimeDescriptionDisplayVerbosityFull,eFormatDefault,summary_format_sp));
+ const SymbolContext& sym_ctx = frame->GetSymbolContext(eSymbolContextFunction);
+ if (sym_ctx.function && sym_ctx.function->IsTopLevelFunction())
+ m_option_variable.show_globals = true;
+
if (variable_list)
{
const Format format = m_option_format.GetFormat();