Skip to content

Commit

Permalink
Revert "[lldb] Tolerate multiple compile units with the same DWO ID (#…
Browse files Browse the repository at this point in the history
…100577)"

The test appears to be flaky. Revert it while I investigate.

This reverts commits 32a62eb and
7027cc6.
  • Loading branch information
labath committed Aug 12, 2024
1 parent b3ed1d9 commit a0c57a0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 159 deletions.
26 changes: 13 additions & 13 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,12 @@ void DWARFUnit::ExtractUnitDIEIfNeeded() {
*m_dwo_id, m_first_die.GetOffset()));
return; // Can't fetch the compile unit from the dwo file.
}

// Link the DWO unit to this object, if it hasn't been linked already (this
// can happen when we have an index, and the DWO unit is parsed first).
if (!dwo_cu->LinkToSkeletonUnit(*this)) {
SetDwoError(Status::createWithFormat(
"multiple compile units with Dwo ID {0:x16}", *m_dwo_id));
return;
}
// If the skeleton compile unit gets its unit DIE parsed first, then this
// will fill in the DWO file's back pointer to this skeleton compile unit.
// If the DWO files get parsed on their own first the skeleton back link
// can be done manually in DWARFUnit::GetSkeletonCompileUnit() which will
// do a reverse lookup and cache the result.
dwo_cu->SetSkeletonUnit(this);

DWARFBaseDIE dwo_cu_die = dwo_cu->GetUnitDIEOnly();
if (!dwo_cu_die.IsValid()) {
Expand Down Expand Up @@ -720,11 +718,13 @@ DWARFCompileUnit *DWARFUnit::GetSkeletonUnit() {
return llvm::dyn_cast_or_null<DWARFCompileUnit>(m_skeleton_unit);
}

bool DWARFUnit::LinkToSkeletonUnit(DWARFUnit &skeleton_unit) {
if (m_skeleton_unit && m_skeleton_unit != &skeleton_unit)
return false;
m_skeleton_unit = &skeleton_unit;
return true;
void DWARFUnit::SetSkeletonUnit(DWARFUnit *skeleton_unit) {
// If someone is re-setting the skeleton compile unit backlink, make sure
// it is setting it to a valid value when it wasn't valid, or if the
// value in m_skeleton_unit was valid, it should be the same value.
assert(skeleton_unit);
assert(m_skeleton_unit == nullptr || m_skeleton_unit == skeleton_unit);
m_skeleton_unit = skeleton_unit;
}

bool DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type() {
Expand Down
2 changes: 1 addition & 1 deletion lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ class DWARFUnit : public UserID {
/// both cases correctly and avoids crashes.
DWARFCompileUnit *GetSkeletonUnit();

bool LinkToSkeletonUnit(DWARFUnit &skeleton_unit);
void SetSkeletonUnit(DWARFUnit *skeleton_unit);

bool Supports_DW_AT_APPLE_objc_complete_type();

Expand Down
145 changes: 0 additions & 145 deletions lldb/test/Shell/SymbolFile/DWARF/x86/dwp-hash-collision.s

This file was deleted.

0 comments on commit a0c57a0

Please sign in to comment.