Skip to content

Move swift runtime failure messages from linkage name to function name #29506

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
Jan 29, 2020

Conversation

medismailben
Copy link
Contributor

This PR moves swift runtimes failure (#25978) messages from the linkage name to the function name.

Since the failure message (i.e. Swift runtime failure: arithmetic overflow) don't conform with a proper mangling, when lldb tries to fetch the inlined frame symbol, it gets discarded. Moving it to the function name fixes this issue.

Signed-off-by: Med Ismail Bennani [email protected]

@medismailben
Copy link
Contributor Author

@swift-ci test

Copy link
Contributor

@eeckstein eeckstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 38cd617ef71017f7fe0b67002abaff600dd79ef9

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 38cd617ef71017f7fe0b67002abaff600dd79ef9

@@ -1864,7 +1864,7 @@ void IRGenDebugInfoImpl::addFailureMessageToCurrentLoc(IRBuilder &Builder,
FuncName += failureMsg;

llvm::DISubprogram *TrapSP = DBuilder.createFunction(
MainModule, StringRef(), FuncName, TrapLoc->getFile(), 0, DIFnTy, 0,
MainModule, FuncName, StringRef(), TrapLoc->getFile(), 0, DIFnTy, 0,
llvm::DINode::FlagArtificial, llvm::DISubprogram::SPFlagDefinition,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please also add a testcase to test/DebugInfo ?

Copy link
Contributor Author

@medismailben medismailben Jan 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the original tests (test/DebugInfo/linetable-codeview.swift & test/IRGen/condfail_message.swift) to reflect my changes.

Should I add another test ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that is fine! For some reason I didn't see this earlier.

@medismailben
Copy link
Contributor Author

@swift-ci test

@medismailben medismailben merged commit 14fd6c8 into swiftlang:master Jan 29, 2020
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.

4 participants