Skip to content

Commit 459279e

Browse files
Merge pull request #6146 from adrian-prantl/manualindex
Manual DWARF index: don't skip over -gmodules debug info
2 parents 8c46bfa + 7951960 commit 459279e

File tree

6 files changed

+32
-10
lines changed

6 files changed

+32
-10
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,24 +161,27 @@ void ManualDWARFIndex::IndexUnit(DWARFUnit &unit, SymbolFileDWARFDwo *dwp,
161161
// though as some functions have template parameter types and other things
162162
// that cause extra copies of types to be included, but we should find these
163163
// types in the .dwo file only as methods could have return types removed and
164-
// we don't have to index incomplete types from the skeletone compile unit.
164+
// we don't have to index incomplete types from the skeleton compile unit.
165165
if (unit.GetDWOId()) {
166166
if (SymbolFileDWARFDwo *dwo_symbol_file = unit.GetDwoSymbolFile()) {
167167
// Type units in a dwp file are indexed separately, so we just need to
168-
// process the split unit here. However, if the split unit is in a dwo file,
169-
// then we need to process type units here.
168+
// process the split unit here. However, if the split unit is in a dwo
169+
// file, then we need to process type units here.
170170
if (dwo_symbol_file == dwp) {
171171
IndexUnitImpl(unit.GetNonSkeletonUnit(), cu_language, set);
172172
} else {
173173
DWARFDebugInfo &dwo_info = dwo_symbol_file->DebugInfo();
174174
for (size_t i = 0; i < dwo_info.GetNumUnits(); ++i)
175175
IndexUnitImpl(*dwo_info.GetUnitAtIndex(i), cu_language, set);
176176
}
177+
return;
177178
}
178-
} else {
179-
// We either have a normal compile unit which we want to index.
180-
IndexUnitImpl(unit, cu_language, set);
179+
// The unit has a dwo_id, but this isn't a .dwo skeleton unit, so
180+
// the assumption is that this is a file produced by -gmodules and
181+
// that we want to index it.
181182
}
183+
// We have a normal compile unit which we want to index.
184+
IndexUnitImpl(unit, cu_language, set);
182185
}
183186

184187
void ManualDWARFIndex::IndexUnitImpl(DWARFUnit &unit,

lldb/test/API/lang/swift/c_type_external_provider/TestSwiftCTypeExternalProvider.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ def setUp(self):
1616
self.main_source_spec = lldb.SBFileSpec(self.main_source)
1717

1818
@swiftTest
19-
@expectedFailureAll(oslist=['linux'], bugnumber='rdar://104671405')
2019
def test_swift_regex(self):
2120
"""Test that C types with builtin metadata emitted are looked up using
2221
external type info provider."""

lldb/test/API/lang/swift/dwarfimporter/BridgingPCH/TestSwiftDWARFImporterBridgingPCH.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def build(self):
4141
@skipIf(oslist=['windows'])
4242
# We delete the pch that would contains the debug info as part of the setup.
4343
#@skipIf(debug_info=no_match(["dsym"]))
44-
@expectedFailureAll(oslist=['linux'], bugnumber='rdar://104670979')
4544
@swiftTest
4645
def test_dwarf_importer(self):
4746
lldb.SBDebugger.MemoryPressureDetected()

lldb/test/API/lang/swift/dwarfimporter/C/TestSwiftDWARFImporterC.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ def build(self):
3939
@swiftTest
4040
# This test needs a working Remote Mirrors implementation.
4141
@skipIf(oslist=['windows'])
42-
@expectedFailureAll(oslist=['linux'], bugnumber='rdar://104670979')
4342
def test_dwarf_importer(self):
4443
self.build()
4544
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
@@ -67,7 +66,6 @@ def test_dwarf_importer(self):
6766
@swiftTest
6867
# This test needs a working Remote Mirrors implementation.
6968
@skipIf(oslist=['windows'])
70-
@expectedFailureAll(oslist=['linux'], bugnumber='rdar://104670979')
7169
def test_dwarf_importer_exprs(self):
7270
self.build()
7371
target, process, thread, bkpt = lldbutil.run_to_source_breakpoint(
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
typedef int anchor_t;
2+
3+
struct TypeFromPCH {
4+
int field;
5+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// UNSUPPORTED: system-windows
2+
3+
// Test that LLDB can follow DWO links produced by -gmodules debug
4+
// info to find a type in a precompiled header.
5+
//
6+
// RUN: %clangxx_host -g -gmodules -fmodules -std=c99 -x c-header %S/Inputs/pch.h -g -c -o %t.pch
7+
// RUN: %clangxx_host -g -gmodules -fmodules -std=c99 -x c -include-pch %t.pch %s -c -o %t.o
8+
// RUN: %clangxx_host %t.o -o %t.exe
9+
// RUN: lldb-test symbols -dump-clang-ast -find type --language=C99 \
10+
// RUN: -compiler-context 'AnyModule:*,Struct:TypeFromPCH' %t.exe | FileCheck %s
11+
12+
anchor_t anchor;
13+
14+
int main(int argc, char **argv) { return 0; }
15+
16+
// CHECK: Found 1 type
17+
// CHECK: "TypeFromPCH"
18+
// CHECK: FieldDecl {{.*}} field

0 commit comments

Comments
 (0)