diff --git a/lldb/include/lldb/Symbol/LineTable.h b/lldb/include/lldb/Symbol/LineTable.h index 299f93e40988f..0323bf5e8039a 100644 --- a/lldb/include/lldb/Symbol/LineTable.h +++ b/lldb/include/lldb/Symbol/LineTable.h @@ -75,7 +75,7 @@ class LineTable { // Append an entry to a caller-provided collection that will later be // inserted in this line table. - void AppendLineEntryToSequence(LineSequence *sequence, lldb::addr_t file_addr, + static void AppendLineEntryToSequence(LineSequence *sequence, lldb::addr_t file_addr, uint32_t line, uint16_t column, uint16_t file_idx, bool is_start_of_statement, bool is_start_of_basic_block, diff --git a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp index 10a41d02aa139..8c25352679d43 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp @@ -1037,20 +1037,23 @@ bool SymbolFileDWARF::ParseLineTable(CompileUnit &comp_unit) { // FIXME: Rather than parsing the whole line table and then copying it over // into LLDB, we should explore using a callback to populate the line table // while we parse to reduce memory usage. - std::unique_ptr line_table_up = - std::make_unique(&comp_unit); - LineSequence *sequence = line_table_up->CreateLineSequenceContainer(); + std::unique_ptr sequence = + LineTable::CreateLineSequenceContainer(); + std::vector> sequences; for (auto &row : line_table->Rows) { - line_table_up->AppendLineEntryToSequence( - sequence, row.Address.Address, row.Line, row.Column, row.File, + LineTable::AppendLineEntryToSequence( + sequence.get(), row.Address.Address, row.Line, row.Column, row.File, row.IsStmt, row.BasicBlock, row.PrologueEnd, row.EpilogueBegin, row.EndSequence); if (row.EndSequence) { - line_table_up->InsertSequence(sequence); - sequence = line_table_up->CreateLineSequenceContainer(); + sequences.push_back(std::move(sequence)); + sequence = LineTable::CreateLineSequenceContainer(); } } + std::unique_ptr line_table_up = + std::make_unique(&comp_unit, std::move(sequences)); + if (SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile()) { // We have an object file that has a line table with addresses that are not // linked. We need to link the line table and convert the addresses that