diff options
author | Ian Lance Taylor <ian@airs.com> | 2010-12-20 18:37:36 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2010-12-20 18:37:36 +0000 |
commit | 7500420b3e1046dac0d90eae795314ecf4a99429 (patch) | |
tree | d1f3d76dc1b3e6d3cb5d5dfc348d45dacde7a637 /gold/dwarf_reader.cc | |
parent | 66a3cb9c76c69ead27cedd1ad8f265dd9197450f (diff) | |
download | gdb-7500420b3e1046dac0d90eae795314ecf4a99429.zip gdb-7500420b3e1046dac0d90eae795314ecf4a99429.tar.gz gdb-7500420b3e1046dac0d90eae795314ecf4a99429.tar.bz2 |
* dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
second of two consecutive entries with same offset.
Diffstat (limited to 'gold/dwarf_reader.cc')
-rw-r--r-- | gold/dwarf_reader.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gold/dwarf_reader.cc b/gold/dwarf_reader.cc index 7fbfdae..8110f38 100644 --- a/gold/dwarf_reader.cc +++ b/gold/dwarf_reader.cc @@ -493,7 +493,18 @@ Sized_dwarf_line_info<size, big_endian>::read_lines(unsigned const char* lineptr Offset_to_lineno_entry entry = { lsm.address, this->current_header_index_, lsm.file_num, lsm.line_num }; - line_number_map_[lsm.shndx].push_back(entry); + std::vector<Offset_to_lineno_entry>& + map(this->line_number_map_[lsm.shndx]); + // If we see two consecutive entries with the same + // offset and a real line number, then always use the + // second one. + if (!map.empty() + && (map.back().offset == static_cast<off_t>(lsm.address)) + && lsm.line_num != -1 + && map.back().line_num != -1) + map.back() = entry; + else + map.push_back(entry); } lineptr += oplength; } |