summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/Block.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2011-08-05 23:43:37 +0000
committerSean Callanan <scallanan@apple.com>2011-08-05 23:43:37 +0000
commit72e4940bd1765afaab46619921cfef681c990d83 (patch)
treef49f14cc3da8f89c173d4ef08e04108aafd4c10a /lldb/source/Symbol/Block.cpp
parent1cd34b8fea60940f99b6a8ce3fd6418953887125 (diff)
downloadbcm5719-llvm-72e4940bd1765afaab46619921cfef681c990d83.tar.gz
bcm5719-llvm-72e4940bd1765afaab46619921cfef681c990d83.zip
This is an overhaul of the expression parser code
that detects what context the current expression is meant to execute in. LLDB now properly consults the method declaration in the debug information rather than trying to hunt down the "this" or "self" pointer by name, which can be misleading. Other fixes include: - LLDB now properly detects that it is inside an inlined C++ member function. - LLDB now allows access to non-const members when in const code. - The functions in SymbolFile that locate the DeclContext containing a DIE have been renamed to reflect what they actually do. I have added new functions that find the DeclContext for the DIE itself. I have also introduced testcases for C++ and Objective-C. llvm-svn: 136999
Diffstat (limited to 'lldb/source/Symbol/Block.cpp')
-rw-r--r--lldb/source/Symbol/Block.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/lldb/source/Symbol/Block.cpp b/lldb/source/Symbol/Block.cpp
index a7d5c5c6f87..8be43e7825d 100644
--- a/lldb/source/Symbol/Block.cpp
+++ b/lldb/source/Symbol/Block.cpp
@@ -11,6 +11,7 @@
#include "lldb/Symbol/Function.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/Section.h"
+#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Symbol/VariableList.h"
@@ -535,6 +536,29 @@ Block::AppendVariables
return num_variables_added;
}
+clang::DeclContext *
+Block::GetClangDeclContextForInlinedFunction()
+{
+ SymbolContext sc;
+
+ CalculateSymbolContext (&sc);
+
+ if (!sc.module_sp)
+ return NULL;
+
+ SymbolVendor *sym_vendor = sc.module_sp->GetSymbolVendor();
+
+ if (!sym_vendor)
+ return NULL;
+
+ SymbolFile *sym_file = sym_vendor->GetSymbolFile();
+
+ if (!sym_file)
+ return NULL;
+
+ return sym_file->GetClangDeclContextForTypeUID (sc, m_uid);
+}
+
void
Block::SetBlockInfoHasBeenParsed (bool b, bool set_children)
{
OpenPOWER on IntegriCloud