summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/StackFrame.cpp
diff options
context:
space:
mode:
authorDawn Perchik <dawn@burble.org>2015-09-04 01:02:30 +0000
committerDawn Perchik <dawn@burble.org>2015-09-04 01:02:30 +0000
commit009d110de476e6a1c9581b1e57a90dd73593b8aa (patch)
treeb3c21aba02ef7872b0b88463b77f5a96d9c92ba8 /lldb/source/Target/StackFrame.cpp
parentb2e9897644383e7e535a3f4465706760b336ca49 (diff)
downloadbcm5719-llvm-009d110de476e6a1c9581b1e57a90dd73593b8aa.tar.gz
bcm5719-llvm-009d110de476e6a1c9581b1e57a90dd73593b8aa.zip
Set the default language to use when evaluating to that of the frame's CU.
* Use the frame's context (instead of just the target's) when evaluating, so that the language of the frame's CU can be used to select the compiler and/or compiler options to use when parsing the expression. This allows for modules built with mixed languages to be parsed in the context of their frame. * Add all C and C++ language variants when determining the language options to set. * Enable C++ language options when language is C or ObjC as a workaround since the expression parser uses features of C++ to capture values. * Enable ObjC language options when language is C++ as a workaround for ObjC requirements. * Disable C++11 language options when language is C++03. * Add test TestMixedLanguages.py to check that the language being used for evaluation is that of the frame. * Fix test TestExprOptions.py to check for C++11 instead of C++ since C++ has to be enabled for C, and remove redundant expr --language test for ObjC. * Fix TestPersistentPtrUpdate.py to not require C++11 in C. Reviewed by: clayborg, spyffe, jingham Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11102 llvm-svn: 246829
Diffstat (limited to 'lldb/source/Target/StackFrame.cpp')
-rw-r--r--lldb/source/Target/StackFrame.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp
index e7baad19ffd..be86be31c04 100644
--- a/lldb/source/Target/StackFrame.cpp
+++ b/lldb/source/Target/StackFrame.cpp
@@ -1316,6 +1316,15 @@ StackFrame::IsInlined ()
return false;
}
+lldb::LanguageType
+StackFrame::GetLanguage ()
+{
+ CompileUnit *cu = GetSymbolContext(eSymbolContextCompUnit).comp_unit;
+ if (cu)
+ return cu->GetLanguage();
+ return lldb::eLanguageTypeUnknown;
+}
+
TargetSP
StackFrame::CalculateTarget ()
{
OpenPOWER on IntegriCloud