Skip to content

🍒[lldb][SymbolFileDWARF] Fall back to using parent DW_AT_LLVM_include_path for submodules #10764

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 2 commits into from
May 30, 2025

Conversation

Michael137
Copy link

Inferred submodule declarations are emitted in DWARF as DW_TAG_modules without DW_AT_LLVM_include_paths. Instead the parent DIE will have the include path. This patch adds support for such setups. Without this, the ClangModulesDeclVendor would fail to AddModule the submodules (i.e., compile and load the submodules). This would cause errors such as:

note: error: Header search couldn't locate module 'TopLevel'

The test added here also tests
llvm#141220. Without that patch we'd fail with:

note: error: No module map file in /Users/jonas/Git/llvm-worktrees/llvm-project/lldb/test/API/lang/cpp/decl-from-submodule

Unfortunately the embedded clang instance doesn't allow us to use the decls we find in the modules. But we'll try to fix that in a separate patch.

rdar://151022173
(cherry picked from commit 7b96272)

…path for submodules (llvm#142044)

Inferred submodule declarations are emitted in DWARF as `DW_TAG_module`s
without `DW_AT_LLVM_include_path`s. Instead the parent DIE will have the
include path. This patch adds support for such setups. Without this, the
`ClangModulesDeclVendor` would fail to `AddModule` the submodules (i.e.,
compile and load the submodules). This would cause errors such as:
```
note: error: Header search couldn't locate module 'TopLevel'
```

The test added here also tests
llvm#141220. Without that patch
we'd fail with:
```
note: error: No module map file in /Users/jonas/Git/llvm-worktrees/llvm-project/lldb/test/API/lang/cpp/decl-from-submodule
```

Unfortunately the embedded clang instance doesn't allow us to use the
decls we find in the modules. But we'll try to fix that in a separate
patch.

rdar://151022173
(cherry picked from commit 7b96272)
@Michael137 Michael137 requested a review from a team as a code owner May 30, 2025 07:40
@Michael137 Michael137 requested a review from adrian-prantl May 30, 2025 07:40
@Michael137
Copy link
Author

@swift-ci test

Or more precisely, when linking with link.exe, but Windows
is our closest proxy for that right now.

This test requires the DWARF info to work, on the Windows on Arm
buildbot it fails:
```
AssertionError: Ran command:
"expr func(1, 2)"

Got output:
error: <user expression 0>:1:1: use of undeclared identifier 'func'

    1 | func(1, 2)

      | ^~~~

Expecting start string: "error: <user expression 0>:1:1: 'func' has unknown return type" (was not found)
```

(cherry picked from commit 7a66b28)
@Michael137
Copy link
Author

@swift-ci test

@adrian-prantl adrian-prantl merged commit 0d47fa0 into swift/release/6.2 May 30, 2025
3 checks passed
@adrian-prantl adrian-prantl deleted the lldb/submodules-search-path-to-6.2 branch May 30, 2025 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants