Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[lldb/DWARF] Search fallback to the manual index in GetFullyQualified… #102123

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ void DebugNamesDWARFIndex::GetFullyQualifiedType(
!ProcessEntry(entry, callback))
return;
}
m_fallback.GetFullyQualifiedType(context, callback);
}

bool DebugNamesDWARFIndex::SameParentChain(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
REQUIRES: lld, python

RUN: split-file %s %t
RUN: %clang --target=x86_64-pc-linux -g -gpubnames -c %t/file1.c -o %t-1.o
RUN: %clang --target=x86_64-pc-linux -g -gno-pubnames -c %t/file2.c -o %t-2.o
RUN: llvm-dwarfdump %t-1.o --debug-names | FileCheck %s --check-prefix=PUBNAMES
RUN: llvm-dwarfdump %t-2.o --debug-names | FileCheck %s --check-prefix=NOPUBNAMES
RUN: ld.lld %t-1.o %t-2.o -o %t.out
RUN: %lldb %t.out -s %t/commands -o exit | FileCheck %s

// Precondition check: The first file should contain a debug_names index, but no
// entries for MYSTRUCT.
PUBNAMES: Name Index @ 0x0 {
PUBNAMES-NOT: MYSTRUCT

// The second file should not contain an index.
NOPUBNAMES-NOT: Name Index

// Starting from the variable in the first file, we should be able to find the
// declaration of the type in the first unit, and then match that with the
// definition in the second unit.
CHECK: (lldb) script
CHECK: struct MYSTRUCT {
CHECK-NEXT: int x;
CHECK-NEXT: }

#--- commands
script lldb.target.FindFirstGlobalVariable("struct_ptr").GetType().GetPointeeType()
#--- file1.c
struct MYSTRUCT *struct_ptr;
#--- file2.c
struct MYSTRUCT {
int x;
};
struct MYSTRUCT struct_;
Loading