summaryrefslogtreecommitdiffstats
path: root/lldb/source/Symbol/ObjectFile.cpp
diff options
context:
space:
mode:
authorTamas Berghammer <tberghammer@google.com>2016-02-10 10:43:34 +0000
committerTamas Berghammer <tberghammer@google.com>2016-02-10 10:43:34 +0000
commited844cbc0f5b9391314edb7d34ea71a060b0faa2 (patch)
tree6677726dba2faf02b4813d3e5eb4d47740c31620 /lldb/source/Symbol/ObjectFile.cpp
parent10e9923841a993978e3acf13bb7b0f893a118b81 (diff)
downloadbcm5719-llvm-ed844cbc0f5b9391314edb7d34ea71a060b0faa2.tar.gz
bcm5719-llvm-ed844cbc0f5b9391314edb7d34ea71a060b0faa2.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. Differential revision: http://reviews.llvm.org/D16996 llvm-svn: 260369
Diffstat (limited to 'lldb/source/Symbol/ObjectFile.cpp')
-rw-r--r--lldb/source/Symbol/ObjectFile.cpp19
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());
+}
+
OpenPOWER on IntegriCloud