Skip to content

Set debug location to Coroutine call expression #81463

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
May 14, 2025

Conversation

rastogishubham
Copy link
Contributor

If debug info generation is enabled, set debug location to the coroutine call instruction to make sure there are no issues with invalid debug information in LTO.

This happens because in LTO, if a call to a function doesn't contain a debug location, we see the warning:

inlinable function call in a function with debug info must have a !dbg location

ld: warning: Invalid debug info found, debug info will be stripped

Which then strips the debug info from the entire .o file linked into the dylib.

@rastogishubham
Copy link
Contributor Author

@swift-ci please test

@rastogishubham
Copy link
Contributor Author

@swift-ci please test

@adrian-prantl
Copy link
Contributor

@swift-ci smoke test

@adrian-prantl
Copy link
Contributor

Error looks unrelated.

@rastogishubham
Copy link
Contributor Author

Hmmm... Test failing with:

 ******************** TEST 'Swift(linux-x86_64) :: Misc/verify-swift-feature-testing.test-sh' FAILED ********************
20:23:07  Exit Code: 1
20:23:07  
20:23:07  Command Output (stdout):
20:23:07  --
20:23:07  /home/build-user/swift/test/IRGen/CoroutineAccessorsDebugLoc.swift: error: file enables 'CoroutineAccessors' but is missing '// REQUIRES: swift_feature_CoroutineAccessors'
20:23:07  
20:23:07  --
20:23:07  Command Output (stderr):

I will add the requires line and try again

If debug info generation is enabled, set debug location to the
coroutine call instruction to make sure there are no issues with invalid
debug information in LTO.

This happens because in LTO, if a call to a function doesn't contain a
debug location, we see the warning:

inlinable function call in a function with debug info must have a
!dbg location

ld: warning: Invalid debug info found, debug info will be stripped

Which then strips the debug info from the entire .o file linked into the
dylib.
@rastogishubham
Copy link
Contributor Author

@swift-ci please test

@rastogishubham
Copy link
Contributor Author

@swift-ci please smoke test

@rastogishubham rastogishubham merged commit 80e8d3a into swiftlang:main May 14, 2025
4 of 5 checks passed
@rastogishubham rastogishubham deleted the AttachDebugLoc branch May 14, 2025 00:30
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.

2 participants