diff options
| author | Tamas Berghammer <tberghammer@google.com> | 2016-02-18 11:12:18 +0000 |
|---|---|---|
| committer | Tamas Berghammer <tberghammer@google.com> | 2016-02-18 11:12:18 +0000 |
| commit | 6b63b148512a6bff3fb4b943d11923f41b696467 (patch) | |
| tree | 69953784c824e1761e2dae1509ed1a51f93f6345 /lldb/source/Symbol/ObjectFile.cpp | |
| parent | a6560ebe4c4bc540d6eb8cbfd60fe0788194c90c (diff) | |
| download | bcm5719-llvm-6b63b148512a6bff3fb4b943d11923f41b696467.tar.gz bcm5719-llvm-6b63b148512a6bff3fb4b943d11923f41b696467.zip | |
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
Diffstat (limited to 'lldb/source/Symbol/ObjectFile.cpp')
| -rw-r--r-- | lldb/source/Symbol/ObjectFile.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
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()); +} + |

