Skip to content

Commit 5011349

Browse files
committed
[lldb] Show the path to the .o instead of the containing .a in progress events
In #133211, Greg pointed out that the old code would print the static archive (the .a file) rather than the actual object file inside of it.
1 parent c676eb7 commit 5011349

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -718,6 +718,15 @@ bool SymbolFileDWARFDebugMap::ParseDebugMacros(CompileUnit &comp_unit) {
718718
return false;
719719
}
720720

721+
static std::string GetObjectName(SymbolFileDWARF &oso_dwarf) {
722+
if (ObjectFile *object_file = oso_dwarf.GetObjectFile()) {
723+
if (ModuleSP module_sp = object_file->GetModule()) {
724+
return module_sp->GetObjectName().GetString();
725+
}
726+
}
727+
return "";
728+
}
729+
721730
void SymbolFileDWARFDebugMap::ForEachSymbolFile(
722731
std::string description,
723732
std::function<IterationAction(SymbolFileDWARF &)> closure) {
@@ -727,12 +736,7 @@ void SymbolFileDWARFDebugMap::ForEachSymbolFile(
727736
/*minimum_report_time=*/std::chrono::milliseconds(20));
728737
for (uint32_t oso_idx = 0; oso_idx < num_oso_idxs; ++oso_idx) {
729738
if (SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx)) {
730-
progress.Increment(oso_idx, oso_dwarf->GetObjectFile()
731-
? oso_dwarf->GetObjectFile()
732-
->GetFileSpec()
733-
.GetFilename()
734-
.GetString()
735-
: "");
739+
progress.Increment(oso_idx, GetObjectName(*oso_dwarf));
736740
if (closure(*oso_dwarf) == IterationAction::Stop)
737741
return;
738742
}

0 commit comments

Comments
 (0)