From 6b63b148512a6bff3fb4b943d11923f41b696467 Mon Sep 17 00:00:00 2001 From: Tamas Berghammer Date: Thu, 18 Feb 2016 11:12:18 +0000 Subject: Improve the handling of missing elf symtab and missing symbol sizes * Generate artificial symbol names from eh_fame during symbol parsing so these symbols are already present when we calcualte the size of the symbols where 0 is specified. * Fix symbol size calculation for the last symbol in the file where it have to last until the end of the parent section. This is the re-commit of the original change after fixing some test failures on OSX. Differential revision: http://reviews.llvm.org/D16996 llvm-svn: 261205 --- lldb/source/Symbol/ObjectFile.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'lldb/source/Symbol/ObjectFile.cpp') diff --git a/lldb/source/Symbol/ObjectFile.cpp b/lldb/source/Symbol/ObjectFile.cpp index 99f9236a2cd..c7ecb76c087 100644 --- a/lldb/source/Symbol/ObjectFile.cpp +++ b/lldb/source/Symbol/ObjectFile.cpp @@ -241,8 +241,7 @@ ObjectFile::ObjectFile (const lldb::ModuleSP &module_sp, lldb::offset_t file_offset, lldb::offset_t length, const lldb::DataBufferSP& data_sp, - lldb::offset_t data_offset -) : + lldb::offset_t data_offset) : ModuleChild (module_sp), m_file (), // This file could be different from the original module's file m_type (eTypeInvalid), @@ -254,7 +253,8 @@ ObjectFile::ObjectFile (const lldb::ModuleSP &module_sp, m_process_wp(), m_memory_addr (LLDB_INVALID_ADDRESS), m_sections_ap(), - m_symtab_ap () + m_symtab_ap (), + m_synthetic_symbol_idx (0) { if (file_spec_ptr) m_file = *file_spec_ptr; @@ -286,7 +286,8 @@ ObjectFile::ObjectFile (const lldb::ModuleSP &module_sp, m_process_wp (process_sp), m_memory_addr (header_addr), m_sections_ap(), - m_symtab_ap () + m_symtab_ap (), + m_synthetic_symbol_idx (0) { if (header_data_sp) m_data.SetData (header_data_sp, 0, header_data_sp->GetByteSize()); @@ -653,3 +654,13 @@ ObjectFile::GetSymbolTypeFromName (llvm::StringRef name, } return symbol_type_hint; } + +ConstString +ObjectFile::GetNextSyntheticSymbolName() +{ + StreamString ss; + ConstString file_name = GetModule()->GetFileSpec().GetFilename(); + ss.Printf("___lldb_unnamed_symbol%u$$%s", ++m_synthetic_symbol_idx, file_name.GetCString()); + return ConstString(ss.GetData()); +} + -- cgit v1.2.3