summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp')
-rw-r--r--lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index 4b18d586093..1c6d9ac6d89 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -367,7 +367,13 @@ SymbolFileDWARFDebugMap::InitOSO()
{
const Symbol *symbol = symtab->SymbolAtIndex(sym_idx);
lldb::addr_t file_addr = symbol->GetAddress().GetFileAddress();
- lldb::addr_t byte_size = symbol->GetByteSize();
+ // The N_GSYM and N_STSYM symbols have a byte size and calling
+ // symbol->GetByteSize() can cause an infinite loop where
+ // InitOSO() gets called over and over if we are in the process
+ // of getting the symbol vendor (module->SymbolVendor()). So
+ // use a safer call for now until we can fix this. This is related
+ // to the unified section/symtab changes that just went in.
+ lldb::addr_t byte_size = symtab->CalculateSymbolSize(const_cast<Symbol *>(symbol));
DebugMap::Entry debug_map_entry(file_addr, byte_size, OSOEntry(sym_idx, LLDB_INVALID_ADDRESS));
m_debug_map.Append(debug_map_entry);
}
OpenPOWER on IntegriCloud