Skip to content

Conversation

adrian-prantl
Copy link

Implement a warning that detects Swift compile units that were compiled with a different Swift compiler than the one that is embedded in LLDB.

rdar://82982242

Choose a reason for hiding this comment

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

cool

Choose a reason for hiding this comment

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

Which scenarios would people want this off?

Copy link
Author

Choose a reason for hiding this comment

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

Any warning that potentially prints on every frame should be switchable. More specifically, I can see how this warning gets annoying when you use LLDB to debug or symbolicate crashes of previously built production software where you just don't have access to a historical matching LLDB.

@adrian-prantl
Copy link
Author

Also added a sanity check to the test.

@adrian-prantl
Copy link
Author

@JDevlieghere Do you think it's reasonable to expect the swiftlang tag to match or should we just match the three most significant components of the version number?

@kastiglione
Copy link

One thing to add: this change may be complimentary, or redundant, to a change in swiftc where it will begin to embed the sdk into swiftmodules. When that happens, deserializing such swiftmodules will return a status of SDKMismatch. See swiftlang/swift-driver#838 and swiftlang/swift#37768.

This has the nice side-effect that it can actually store the quadruple version numbers that Apple's tools are using nowadays.

rdar://82982162

Differential Revision: https://reviews.llvm.org/D111200

(cherry picked from commit 14aa3f3)

 Conflicts:
	lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
(cherry picked from commit 2edb905)
This patch adds support for Swift compiler producer strings to DWARFUnit.

Differential Revision: https://reviews.llvm.org/D111278

(cherry picked from commit aab7afeec1fb771c8ae044257d44f6362d72c732)
@adrian-prantl adrian-prantl force-pushed the 82982242 branch 2 times, most recently from 4aa3e49 to 58c5b07 Compare October 9, 2021 00:54
@adrian-prantl
Copy link
Author

After discussing this with @JDevlieghere I changed the check to leave off the build number, to reduce the risk of benign mismatches triggering false positives. Due to procedural reasons the compiler and debugger may be legitimately a few numbers apart.

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test

3 similar comments
@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test

@shahmishal
Copy link
Member

@swift-ci test

Choose a reason for hiding this comment

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

As a follow up patch, can we get rid of this function and the PrintWarning.* ones below by moving them into the language plugin?

Comment on lines +612 to +615

Choose a reason for hiding this comment

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

Why can't this live upstream?

Copy link
Author

Choose a reason for hiding this comment

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

This is a cherry-pick.

@adrian-prantl
Copy link
Author

@swift-ci test

1 similar comment
@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl
Copy link
Author

@swift-ci test

…ed with

a different Swift compiler than the one that is embedded in LLDB.

rdar://82982242
@adrian-prantl
Copy link
Author

@swift-ci test

1 similar comment
@adrian-prantl
Copy link
Author

@swift-ci test

@adrian-prantl adrian-prantl merged commit 193a81e into swiftlang:stable/20210726 Oct 14, 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.

4 participants