DObj->getLineSection().Data)) {
DWARFDataExtractor LineData(*DObj, DObj->getLineSection(), isLittleEndian(),
0);
- DWARFDebugLine::SectionParser Parser(LineData, *this, compile_units(),
- type_units());
+ DWARFDebugLine::SectionParser Parser(LineData, *this, normal_units());
DumpLineSection(Parser, DumpOpts, *Off);
}
DObj->getLineDWOSection().Data)) {
DWARFDataExtractor LineData(*DObj, DObj->getLineDWOSection(),
isLittleEndian(), 0);
- DWARFDebugLine::SectionParser Parser(LineData, *this, dwo_compile_units(),
- dwo_type_units());
+ DWARFDebugLine::SectionParser Parser(LineData, *this, dwo_units());
DumpLineSection(Parser, DumpOpts, *Off);
}
// Therefore, collect up handles on all the Units that point into the
// line-table section.
static DWARFDebugLine::SectionParser::LineToUnitMap
-buildLineToUnitMap(DWARFDebugLine::SectionParser::cu_range CUs,
- DWARFDebugLine::SectionParser::tu_range TUs) {
+buildLineToUnitMap(DWARFUnitVector::iterator_range Units) {
DWARFDebugLine::SectionParser::LineToUnitMap LineToUnit;
- for (const auto &CU : CUs)
- if (auto CUDIE = CU->getUnitDIE())
+ for (const auto &U : Units)
+ if (auto CUDIE = U->getUnitDIE())
if (auto StmtOffset = toSectionOffset(CUDIE.find(DW_AT_stmt_list)))
- LineToUnit.insert(std::make_pair(*StmtOffset, &*CU));
- for (const auto &TU : TUs)
- if (auto TUDIE = TU->getUnitDIE())
- if (auto StmtOffset = toSectionOffset(TUDIE.find(DW_AT_stmt_list)))
- LineToUnit.insert(std::make_pair(*StmtOffset, &*TU));
+ LineToUnit.insert(std::make_pair(*StmtOffset, &*U));
return LineToUnit;
}
-DWARFDebugLine::SectionParser::SectionParser(DWARFDataExtractor &Data,
- const DWARFContext &C,
- cu_range CUs, tu_range TUs)
+DWARFDebugLine::SectionParser::SectionParser(
+ DWARFDataExtractor &Data, const DWARFContext &C,
+ DWARFUnitVector::iterator_range Units)
: DebugLineData(Data), Context(C) {
- LineToUnit = buildLineToUnitMap(CUs, TUs);
+ LineToUnit = buildLineToUnitMap(Units);
if (!DebugLineData.isValidOffset(Offset))
Done = true;
}
generate();
- return DWARFDebugLine::SectionParser(LineData, *Context, CUs, TUs);
+ return DWARFDebugLine::SectionParser(LineData, *Context, Units);
}
void recordRecoverable(Error Err) {
Error Unrecoverable;
std::function<void(Error)> RecordUnrecoverable;
- SmallVector<std::unique_ptr<DWARFUnit>, 2> CUs;
- SmallVector<std::unique_ptr<DWARFUnit>, 2> TUs;
+ SmallVector<std::unique_ptr<DWARFUnit>, 2> Units;
};
// Fixtures must derive from "Test", but parameterised fixtures from
return;
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
EXPECT_TRUE(Parser.done());
}
Gen->addLineTable();
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
Parser.parseNext(RecordRecoverable, RecordUnrecoverable);
EXPECT_EQ(Parser.getOffset(), 0u);
Gen->addLineTable();
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
Parser.skip(RecordRecoverable, RecordUnrecoverable);
EXPECT_EQ(Parser.getOffset(), 0u);
LT2.setCustomPrologue({{2, LineTable::Long}, {1, LineTable::Half}});
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
Parser.parseNext(RecordRecoverable, RecordUnrecoverable);
ASSERT_FALSE(Parser.done());
Parser.parseNext(RecordRecoverable, RecordUnrecoverable);
LT2.addByte(0xbb);
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
Parser.parseNext(RecordRecoverable, RecordUnrecoverable);
EXPECT_FALSE(Unrecoverable);
ASSERT_FALSE(Parser.done());
LT2.setCustomPrologue({{2, LineTable::Long}, {1, LineTable::Half}});
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
Parser.skip(RecordRecoverable, RecordUnrecoverable);
ASSERT_FALSE(Parser.done());
Parser.skip(RecordRecoverable, RecordUnrecoverable);
LT.addExtendedOpcode(42, DW_LNE_end_sequence, {});
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
Parser.skip(RecordRecoverable, RecordUnrecoverable);
EXPECT_TRUE(Parser.done());
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
std::string Output;
raw_string_ostream OS(Output);
Parser.parseNext(RecordRecoverable, RecordUnrecoverable, &OS,
void runTest(uint8_t OpcodeValue) {
generate();
- DWARFDebugLine::SectionParser Parser(LineData, *Context, CUs, TUs);
+ DWARFDebugLine::SectionParser Parser(LineData, *Context, Units);
std::string Output;
raw_string_ostream OS(Output);
Parser.parseNext(RecordRecoverable, RecordUnrecoverable, &OS,