summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-06-12 16:50:01 +0000
committerPavel Labath <labath@google.com>2018-06-12 16:50:01 +0000
commit0e33a0cd58ac7e7764943b5b478ea6812d890476 (patch)
tree24befdec88016242d1756c6335a4b5186f8b9723 /lldb/source/Plugins/SymbolFile
parentf72cdb50bef481d0a2057c9e55b3612a6c05b839 (diff)
downloadbcm5719-llvm-0e33a0cd58ac7e7764943b5b478ea6812d890476.tar.gz
bcm5719-llvm-0e33a0cd58ac7e7764943b5b478ea6812d890476.zip
DebugNamesDWARFIndex: Implement DWARFDeclContext variant of GetTypes method
This method is used to find complete definitions of a type when one parses a compile unit with only forward declaration available. Since it is only accessed from DWARFASTParserClang, it was not possible/easy to trigger this codepath from lldb-test. Therefore, I adapt add a debug-names variant to an existing dotest test to cover this scenario. llvm-svn: 334516
Diffstat (limited to 'lldb/source/Plugins/SymbolFile')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp12
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h2
2 files changed, 13 insertions, 1 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
index 644110c8295..4a595ce72d0 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
@@ -9,6 +9,7 @@
#include "Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h"
#include "Plugins/SymbolFile/DWARF/DWARFDebugInfo.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDeclContext.h"
#include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h"
#include "lldb/Utility/RegularExpression.h"
#include "lldb/Utility/Stream.h"
@@ -155,6 +156,17 @@ void DebugNamesDWARFIndex::GetTypes(ConstString name, DIEArray &offsets) {
}
}
+void DebugNamesDWARFIndex::GetTypes(const DWARFDeclContext &context,
+ DIEArray &offsets) {
+ m_fallback.GetTypes(context, offsets);
+
+ for (const DebugNames::Entry &entry :
+ m_debug_names_up->equal_range(context[0].name)) {
+ if (entry.tag() == context[0].tag)
+ Append(entry, offsets);
+ }
+}
+
void DebugNamesDWARFIndex::GetNamespaces(ConstString name, DIEArray &offsets) {
m_fallback.GetNamespaces(name, offsets);
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
index 3daea75977a..4f0b1cee420 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
@@ -33,7 +33,7 @@ public:
void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation,
DIEArray &offsets) override {}
void GetTypes(ConstString name, DIEArray &offsets) override;
- void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override {}
+ void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override;
void GetNamespaces(ConstString name, DIEArray &offsets) override;
void GetFunctions(ConstString name, DWARFDebugInfo &info,
const CompilerDeclContext &parent_decl_ctx,
OpenPOWER on IntegriCloud