Skip to content

[lldb/test] Add basic ld.lld --debug-names tests #88335

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

Merged
merged 1 commit into from
Apr 23, 2024

Conversation

MaskRay
Copy link
Member

@MaskRay MaskRay commented Apr 11, 2024

Test that ld.lld --debug-names (#86508) built per-module index can be
consumed by lldb. This has uncovered a bug during the development of the
lld feature.

@MaskRay
Copy link
Member Author

MaskRay commented Apr 11, 2024

This is not for review yet. When ld.lld --debug-names is added, this PR will be changed to add a few lines to lldb/test/Shell/SymbolFile/DWARF/x86 tests.

Test that ld.lld --debug-names (llvm#86508) built per-module index can be
consumed by lldb. This has uncovered a bug during the development of the
lld feature.
@MaskRay MaskRay force-pushed the lldb-lld-debug-names-test branch from fb7a33c to 210b1e8 Compare April 19, 2024 16:28
@MaskRay MaskRay marked this pull request as ready for review April 19, 2024 16:28
@MaskRay MaskRay requested a review from JDevlieghere as a code owner April 19, 2024 16:28
@llvmbot llvmbot added the lldb label Apr 19, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 19, 2024

@llvm/pr-subscribers-lldb

Author: Fangrui Song (MaskRay)

Changes

Test that ld.lld --debug-names (#86508) built per-module index can be
consumed by lldb. This has uncovered a bug during the development of the
lld feature.


Full diff: https://github.com/llvm/llvm-project/pull/88335.diff

2 Files Affected:

  • (modified) lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-function.cpp (+5)
  • (modified) lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-variable.cpp (+5)
diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-function.cpp b/lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-function.cpp
index 30143a41d5e734..b9a63525d0711d 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-function.cpp
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-function.cpp
@@ -59,6 +59,11 @@
 // RUN: lldb-test symbols --name=not_there --find=function %t | \
 // RUN:   FileCheck --check-prefix=EMPTY %s
 
+/// Test a per-module index built by lld.
+// RUN: ld.lld --debug-names %t.o -o %t
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=base %t | \
+// RUN:   FileCheck --check-prefix=BASE %s
+
 // NAMES: Name: .debug_names
 
 // BASE: Found 4 functions:
diff --git a/lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-variable.cpp b/lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-variable.cpp
index 98b4097cdda01f..e46fa14489d32d 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-variable.cpp
+++ b/lldb/test/Shell/SymbolFile/DWARF/x86/find-basic-variable.cpp
@@ -33,6 +33,11 @@
 // RUN: lldb-test symbols --name=not_there --find=variable %t | \
 // RUN:   FileCheck --check-prefix=EMPTY %s
 
+/// Test a per-module index built by lld.
+// RUN: ld.lld --debug-names %t.o -o %t
+// RUN: lldb-test symbols --name=foo --find=variable --context=context %t | \
+// RUN:   FileCheck --check-prefix=CONTEXT %s
+
 // NAMES: Name: .debug_names
 
 // EMPTY: Found 0 variables:

@dwblaikie
Copy link
Collaborator

looks approximately right to me, but wouldn't' mind a set of eyes more familiar with lldb to take a look

@MaskRay MaskRay merged commit a7e2726 into llvm:main Apr 23, 2024
6 of 7 checks passed
@MaskRay MaskRay deleted the lldb-lld-debug-names-test branch April 23, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants