Skip to content

Support additional salvage debug info opportunities #39341

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 11 commits into from
Sep 20, 2021

Conversation

adrian-prantl
Copy link
Contributor

This picks up a PR from @mshockwave with some additional bugfixes on top.

mshockwave and others added 6 commits September 10, 2021 14:17
And calling `swift::salvageDebugInfo` in more places.

NOTE: The latter change seems to break stdlib build.
This rule tries to prevent two DIVariables -- with different types --
conflicting with each other on the same argument number.
If this rule fails, it's highly possible that we forgot to add
'inlinedAt' somewhere.
@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 863184bba7333d6e240d8f446ce74442413b7baf

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 863184bba7333d6e240d8f446ce74442413b7baf

Copy link
Contributor

@mshockwave mshockwave left a comment

Choose a reason for hiding this comment

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

Thank you Adrian for wrapping up this patch!
Just want to make sure I understand correctly about this patch: If we're dealing with a debug_value that has a fragment, the debug variable size will essentially be zero. But then I'm wondering: Will LLVM be happy about a !DIVariable that has zero size?

}
int64_t Val;
// FIXME: Use the correct diagnostic
if (parseInteger(Val, diag::sil_invalid_scope_slot))
Copy link
Contributor

@mshockwave mshockwave Sep 17, 2021

Choose a reason for hiding this comment

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

Can you create a new diagnostic message for this? (something like "expecting an integer", or just reuse an existing one)

if (auto Expr = VarInfo->DIExpr)
if (auto n = Expr.getNumElements())
if (Expr.getElement(n - 1).getAsOperator() ==
SILDIExprOperator::Fragment)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think SILDebugInfoExpression::hasFragment can be used here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Much better!

if (auto Expr = VarInfo->DIExpr)
if (auto n = Expr.getNumElements())
if (Expr.getElement(n - 1).getAsOperator() ==
SILDIExprOperator::Fragment)
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto SILDebugInfoExpression::hasFragment

@adrian-prantl
Copy link
Contributor Author

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - dc50c93

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - dc50c93

@adrian-prantl adrian-prantl merged commit 7e7333e into swiftlang:rebranch Sep 20, 2021
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