size_t Index = 0;
dbgs() << "\nSectionIndex: " << format_decimal(SectionIndex, 3)
<< " Scope DIE: " << hexValue(Scope->getOffset()) << "\n"
- << format("Process instructions lines: %d\n",
+ << format("Process instruction lines: %d\n",
InstructionLines.size());
for (const LVLine *Line : InstructionLines)
dbgs() << format_decimal(++Index, 5) << ": "
if (DebugLines->empty()) {
if (const LVScopes *Scopes = CompileUnit->getScopes())
for (LVScope *Scope : *Scopes) {
- if (Scope->getIsArtificial())
- continue;
LVLines *Lines = ScopeInstructions.find(Scope);
if (Lines) {
size_t Index = 0;
dbgs() << "\nSectionIndex: " << format_decimal(SectionIndex, 3)
<< " Scope DIE: " << hexValue(Scope->getOffset()) << "\n"
- << format("Instructions lines: %d\n", Lines->size());
+ << format("Instruction lines: %d\n", Lines->size());
for (const LVLine *Line : *Lines)
dbgs() << format_decimal(++Index, 5) << ": "
<< hexValue(Line->getOffset()) << ", (" << Line->getName()
<< ")\n";
});
- DebugLines->append(*Lines);
+ if (Scope->getIsArtificial()) {
+ // Add the instruction lines to their artificial scope.
+ for (LVLine *Line : *Lines)
+ Scope->addElement(Line);
+ } else {
+ DebugLines->append(*Lines);
+ }
Lines->clear();
}
}
// In DWARF5 the file indexes start at 0;
bool IncrementIndex = Lines->Prologue.getVersion() >= 5;
- // Get the source lines.
- if ((options().getAttributeRange() || options().getPrintLines()) &&
- Lines->Rows.size())
+ // Get the source lines if requested by command line option.
+ if (options().getPrintLines() && Lines->Rows.size())
for (const DWARFDebugLine::Row &Row : Lines->Rows) {
// Here we collect logical debug lines in CULines. Later on,
// the 'processLines()' function will move each created logical line
llvm::sys::InitializeCOMRAII COM(llvm::sys::COMThreadingMode::MultiThreaded);
- SmallString<128> InputsDir = unittest::getInputFileDirectory(TestMainArgv0);
-
- // This test requires a x86-registered-target
+ // This test requires a x86-registered-target.
Triple TT;
TT.setArch(Triple::x86_64);
TT.setVendor(Triple::UnknownVendor);
if (!TargetRegistry::lookupTarget(std::string(TT.str()), TargetLookupError))
return;
+ SmallString<128> InputsDir = unittest::getInputFileDirectory(TestMainArgv0);
+
// Logical elements general properties and selection.
elementProperties(InputsDir);
elementSelection(InputsDir);