diff options
author | Ravitheja Addepally <ravitheja.addepally@intel.com> | 2015-11-03 14:24:24 +0000 |
---|---|---|
committer | Ravitheja Addepally <ravitheja.addepally@intel.com> | 2015-11-03 14:24:24 +0000 |
commit | 46bcbaafb5467d26814243bf3e7bfb2bbfb78246 (patch) | |
tree | b33c4035b317a3795186ad498f70ed73b9d78949 /lldb/source/Plugins/SymbolFile | |
parent | 0ca1e2c3f92610bbb552e69daaaa0173dbb7a5e2 (diff) | |
download | bcm5719-llvm-46bcbaafb5467d26814243bf3e7bfb2bbfb78246.tar.gz bcm5719-llvm-46bcbaafb5467d26814243bf3e7bfb2bbfb78246.zip |
Changes for Bug 25251
Summary:
The solution to bug 24074,rL249673 needed
to parse the function information from the Dwarf in order
to set the SymbolContext. For that, GetFunction was called
for the parent in GetTypeForDIE, which parses the
ChildParameters and in the flow, GetTypeForDIE was called
for one of the sibling die and so an infinite
loop was triggered by calling GetFunction repeatedly for the
same function.
The changes in this revision modify the GetTypeForDIE to only
resolve the function context in the Type Lookup flow and so
prevent the infinite loop.
A testcase has also been added to check for regression in the
future and a test vector had been added to the testcase of
24074.
Reviewers: jingham, tberghammer, clayborg
Differential Revision: http://reviews.llvm.org/D14202
llvm-svn: 251917
Diffstat (limited to 'lldb/source/Plugins/SymbolFile')
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 12 | ||||
-rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h | 5 |
2 files changed, 9 insertions, 8 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 6ff1c986558..1186fed2b92 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1559,14 +1559,14 @@ SymbolFileDWARF::CompleteType (CompilerType &compiler_type) } Type* -SymbolFileDWARF::ResolveType (const DWARFDIE &die, bool assert_not_being_parsed) +SymbolFileDWARF::ResolveType (const DWARFDIE &die, bool assert_not_being_parsed, bool resolve_function_context) { if (die) { Type *type = GetDIEToType().lookup (die.GetDIE()); if (type == NULL) - type = GetTypeForDIE (die).get(); + type = GetTypeForDIE (die, resolve_function_context).get(); if (assert_not_being_parsed) { @@ -2927,7 +2927,7 @@ SymbolFileDWARF::FindTypes (const SymbolContext& sc, if (!DIEInDeclContext(parent_decl_ctx, die)) continue; // The containing decl contexts don't match - Type *matching_type = ResolveType (die); + Type *matching_type = ResolveType (die, true, true); if (matching_type) { // We found a type pointer, now find the shared pointer form our type list @@ -3065,7 +3065,7 @@ SymbolFileDWARF::FindNamespace (const SymbolContext& sc, } TypeSP -SymbolFileDWARF::GetTypeForDIE (const DWARFDIE &die) +SymbolFileDWARF::GetTypeForDIE (const DWARFDIE &die, bool resolve_function_context) { TypeSP type_sp; if (die) @@ -3084,7 +3084,7 @@ SymbolFileDWARF::GetTypeForDIE (const DWARFDIE &die) parent_die = parent_die->GetParent(); } SymbolContext sc_backup = sc; - if (parent_die != nullptr && !GetFunction(DWARFDIE(die.GetCU(),parent_die), sc)) + if (resolve_function_context && parent_die != nullptr && !GetFunction(DWARFDIE(die.GetCU(),parent_die), sc)) sc = sc_backup; type_sp = ParseType(sc, die, NULL); @@ -3270,7 +3270,7 @@ SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE (const DWARFDIE &die, if (try_resolving_type) { - Type *resolved_type = ResolveType (type_die, false); + Type *resolved_type = ResolveType (type_die, false, true); if (resolved_type && resolved_type != DIE_IS_BEING_PARSED) { DEBUG_PRINTF ("resolved 0x%8.8" PRIx64 " from %s to 0x%8.8" PRIx64 " (cu 0x%8.8" PRIx64 ")\n", diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h index ccd85e805e2..818ce68eabb 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h @@ -148,7 +148,8 @@ public: lldb_private::Type * ResolveType (const DWARFDIE &die, - bool assert_not_being_parsed = true); + bool assert_not_being_parsed = true, + bool resolve_function_context = false); lldb_private::CompilerDecl GetDeclForUID (lldb::user_id_t uid) override; @@ -434,7 +435,7 @@ protected: lldb_private::SymbolContextList& sc_list); lldb::TypeSP - GetTypeForDIE (const DWARFDIE &die); + GetTypeForDIE (const DWARFDIE &die, bool resolve_function_context = false); void Index(); |