summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/include/lldb/Symbol/Symbol.h3
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp6
-rw-r--r--lldb/source/Symbol/Symbol.cpp7
-rw-r--r--lldb/source/Symbol/Symtab.cpp23
4 files changed, 12 insertions, 27 deletions
diff --git a/lldb/include/lldb/Symbol/Symbol.h b/lldb/include/lldb/Symbol/Symbol.h
index 43f29f368d9..c77d3dea4bd 100644
--- a/lldb/include/lldb/Symbol/Symbol.h
+++ b/lldb/include/lldb/Symbol/Symbol.h
@@ -383,9 +383,6 @@ public:
bool prefer_file_cache,
Stream &strm);
- bool
- ContainsFileAddress (lldb::addr_t file_addr) const;
-
protected:
// This is the internal guts of ResolveReExportedSymbol, it assumes reexport_name is not null, and that module_spec
// is valid. We track the modules we've already seen to make sure we don't get caught in a cycle.
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index ed4af5e9826..b16a2cda10f 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -2295,7 +2295,7 @@ ObjectFileELF::ParseSymbols (Symtab *symtab,
symbol_section_sp, // Section in which this symbol is defined or null.
symbol_value, // Offset in section or symbol value.
symbol.st_size), // Size in bytes of this symbol.
- true, // Symbol size is valid
+ symbol.st_size != 0, // Size is valid if it is not 0
has_suffix, // Contains linker annotations?
flags); // Symbol flags.
symtab->AddSymbol(dc_symbol);
@@ -2304,9 +2304,7 @@ ObjectFileELF::ParseSymbols (Symtab *symtab,
}
unsigned
-ObjectFileELF::ParseSymbolTable(Symtab *symbol_table,
- user_id_t start_id,
- lldb_private::Section *symtab)
+ObjectFileELF::ParseSymbolTable(Symtab *symbol_table, user_id_t start_id, lldb_private::Section *symtab)
{
if (symtab->GetObjectFile() != this)
{
diff --git a/lldb/source/Symbol/Symbol.cpp b/lldb/source/Symbol/Symbol.cpp
index 1fa792c9729..5884fcaa551 100644
--- a/lldb/source/Symbol/Symbol.cpp
+++ b/lldb/source/Symbol/Symbol.cpp
@@ -737,10 +737,3 @@ Symbol::GetDisassembly (const ExecutionContext &exe_ctx,
}
return false;
}
-
-bool
-Symbol::ContainsFileAddress (lldb::addr_t file_addr) const
-{
- return m_addr_range.ContainsFileAddress(file_addr);
-}
-
diff --git a/lldb/source/Symbol/Symtab.cpp b/lldb/source/Symbol/Symtab.cpp
index 31db57289fd..b20504addec 100644
--- a/lldb/source/Symbol/Symtab.cpp
+++ b/lldb/source/Symbol/Symtab.cpp
@@ -971,11 +971,9 @@ Symtab::InitAddressIndexes()
if (end_section_file_addr > symbol_file_addr)
{
Symbol &symbol = m_symbols[entry.data];
- if (!symbol.GetByteSizeIsValid())
- {
- symbol.SetByteSize(end_section_file_addr - symbol_file_addr);
- symbol.SetSizeIsSynthesized(true);
- }
+
+ symbol.SetByteSize(end_section_file_addr - symbol_file_addr);
+ symbol.SetSizeIsSynthesized(true);
}
}
}
@@ -1041,15 +1039,18 @@ Symtab::FindSymbolContainingFileAddress (addr_t file_addr, const uint32_t* index
return info.match_symbol;
}
- if (!info.match_symbol->GetByteSizeIsValid())
+ const size_t symbol_byte_size = info.match_symbol->GetByteSize();
+
+ if (symbol_byte_size == 0)
{
- // The matched symbol dosn't have a valid byte size so lets just go with that match...
+ // We weren't able to find the size of the symbol so lets just go
+ // with that match we found in our search...
return info.match_symbol;
}
// We were able to figure out a symbol size so lets make sure our
// offset puts "file_addr" in the symbol's address range.
- if (info.match_offset < info.match_symbol->GetByteSize())
+ if (info.match_offset < symbol_byte_size)
return info.match_symbol;
}
return nullptr;
@@ -1065,11 +1066,7 @@ Symtab::FindSymbolContainingFileAddress (addr_t file_addr)
const FileRangeToIndexMap::Entry *entry = m_file_addr_to_index.FindEntryThatContains(file_addr);
if (entry)
- {
- Symbol* symbol = SymbolAtIndex(entry->data);
- if (symbol->ContainsFileAddress(file_addr))
- return symbol;
- }
+ return SymbolAtIndex(entry->data);
return nullptr;
}
OpenPOWER on IntegriCloud