Skip to content

Set debug location to Coroutine call expression#81463

Merged
rastogishubham merged 1 commit intoswiftlang:mainfrom
rastogishubham:AttachDebugLoc
May 14, 2025
Merged

Set debug location to Coroutine call expression#81463
rastogishubham merged 1 commit intoswiftlang:mainfrom
rastogishubham:AttachDebugLoc

Conversation

@rastogishubham
Copy link
Copy Markdown

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
Copy Markdown
Author

@swift-ci please test

@rastogishubham
Copy link
Copy Markdown
Author

@swift-ci please test

@adrian-prantl
Copy link
Copy Markdown
Contributor

@swift-ci smoke test

@adrian-prantl
Copy link
Copy Markdown
Contributor

Error looks unrelated.

@rastogishubham
Copy link
Copy Markdown
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
Copy Markdown
Author

@swift-ci please test

@rastogishubham
Copy link
Copy Markdown
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