diff options
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp')
| -rw-r--r-- | lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 2dd7ae60b231..8c20244a6c44 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -2067,6 +2067,13 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext( } void SymbolFileDWARF::PreloadSymbols() { + // Get the symbol table for the symbol file prior to taking the module lock + // so that it is available without needing to take the module lock. The DWARF + // indexing might end up needing to relocate items when DWARF sections are + // loaded as they might end up getting the section contents which can call + // ObjectFileELF::RelocateSection() which in turn will ask for the symbol + // table and can cause deadlocks. + GetSymtab(); std::lock_guard<std::recursive_mutex> guard(GetModuleMutex()); m_index->Preload(); } @@ -3271,15 +3278,14 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc, } const DWARFDIE parent_context_die = GetDeclContextDIEContainingDIE(die); - const dw_tag_t parent_tag = die.GetParent().Tag(); + const DWARFDIE sc_parent_die = GetParentSymbolContextDIE(die); + const dw_tag_t parent_tag = sc_parent_die.Tag(); bool is_static_member = (parent_tag == DW_TAG_compile_unit || parent_tag == DW_TAG_partial_unit) && (parent_context_die.Tag() == DW_TAG_class_type || parent_context_die.Tag() == DW_TAG_structure_type); ValueType scope = eValueTypeInvalid; - - const DWARFDIE sc_parent_die = GetParentSymbolContextDIE(die); SymbolContextScope *symbol_context_scope = nullptr; bool has_explicit_mangled = mangled != nullptr; |
