Skip to content

Commit b3ed1d9

Browse files
committed
Reapply "[lldb/DWARF] Search fallback to the manual index in GetFullyQualified… (#102123)"
This reverts commit 38b67c5. I reverted the wrong patch -- sorry :(
1 parent 38b67c5 commit b3ed1d9

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ void DebugNamesDWARFIndex::GetFullyQualifiedType(
371371
!ProcessEntry(entry, callback))
372372
return;
373373
}
374+
m_fallback.GetFullyQualifiedType(context, callback);
374375
}
375376

376377
bool DebugNamesDWARFIndex::SameParentChain(

lldb/test/Shell/SymbolFile/DWARF/x86/dwp-hash-collision.s

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
## split unit from the DWP file. This can sometimes happen when the compile unit
44
## is nearly empty (e.g. because LTO has optimized all of it away).
55

6+
# Is flaky on Windows on Arm.
7+
# UNSUPPORTED: system-windows
8+
69
# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s --defsym MAIN=0 > %t
710
# RUN: llvm-mc -triple=x86_64-pc-linux -filetype=obj %s > %t.dwp
811
# RUN: %lldb %t -o "image lookup -t my_enum_type" \
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
REQUIRES: lld, python
2+
3+
RUN: split-file %s %t
4+
RUN: %clang --target=x86_64-pc-linux -g -gpubnames -c %t/file1.c -o %t-1.o
5+
RUN: %clang --target=x86_64-pc-linux -g -gno-pubnames -c %t/file2.c -o %t-2.o
6+
RUN: llvm-dwarfdump %t-1.o --debug-names | FileCheck %s --check-prefix=PUBNAMES
7+
RUN: llvm-dwarfdump %t-2.o --debug-names | FileCheck %s --check-prefix=NOPUBNAMES
8+
RUN: ld.lld %t-1.o %t-2.o -o %t.out
9+
RUN: %lldb %t.out -s %t/commands -o exit | FileCheck %s
10+
11+
// Precondition check: The first file should contain a debug_names index, but no
12+
// entries for MYSTRUCT.
13+
PUBNAMES: Name Index @ 0x0 {
14+
PUBNAMES-NOT: MYSTRUCT
15+
16+
// The second file should not contain an index.
17+
NOPUBNAMES-NOT: Name Index
18+
19+
// Starting from the variable in the first file, we should be able to find the
20+
// declaration of the type in the first unit, and then match that with the
21+
// definition in the second unit.
22+
CHECK: (lldb) script
23+
CHECK: struct MYSTRUCT {
24+
CHECK-NEXT: int x;
25+
CHECK-NEXT: }
26+
27+
#--- commands
28+
script lldb.target.FindFirstGlobalVariable("struct_ptr").GetType().GetPointeeType()
29+
#--- file1.c
30+
struct MYSTRUCT *struct_ptr;
31+
#--- file2.c
32+
struct MYSTRUCT {
33+
int x;
34+
};
35+
struct MYSTRUCT struct_;

0 commit comments

Comments
 (0)