Skip to content

[lldb][Target] Refactor Target::FindLoadAddr #7544

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

Conversation

chelcassanova
Copy link

Target::FindLoadAddrForNameInSymbolsAndPersistentVariables has been split into Target::FindLoadAddrForNameInSymbols and Target::FindLoadAddrForNameInPersistentVariables. Instead of performing both searches in one function,
Target::FindLoadAddrForNameInSymbolsAndPersistentVariables will call its constituent functions.

This allows SwiftLanguageRuntime::FindSymbolForSwiftObject to look for symbols with Target::FindLoadAddrForNameInSymbols instead of performing this search on its own.

rdar://32228544

`Target::FindLoadAddrForNameInSymbolsAndPersistentVariables` has been
split into `Target::FindLoadAddrForNameInSymbols` and
`Target::FindLoadAddrForNameInPersistentVariables`. Instead of
performing both searches in one function,
`Target::FindLoadAddrForNameInSymbolsAndPersistentVariables` will call
its constituent functions.

This allows `SwiftLanguageRuntime::FindSymbolForSwiftObject` to look for symbols
with `Target::FindLoadAddrForNameInSymbols` instead of performing this
search on its own.

rdar://32228544
@JDevlieghere
Copy link

This looks like generic code, should this target llvm.org rather than the Swift fork?

@chelcassanova
Copy link
Author

FindLoadAddrForNameInSymbolsAndPersistentVariables has no usage in the codebase and can removed, the same goes for FindLoadAddrForNameInPersistentVariables. SwiftLanguageRuntime::FindSymbolForSwiftObject is using FindLoadAddrForNameInSymbols but if that's the only place that FindLoadAddrForNameInSymbols would get used then we could go back to the original implementation of FindSymbolForSwiftObject to remove FindLoadAddrForNameInSymbolsAndPersistentVariables altogether.

This reverts commit 2542856. Remove
`Target::FindLoadAddrForNameInSymbolsAndPersistentVariables` as this is
going unused in the codebase. As such the implementation being used in
`FindSymbolForSwiftObject` is reverted to its original version.
@JDevlieghere
Copy link

@swift-ci test

@JDevlieghere JDevlieghere merged commit 718808e into swiftlang:stable/20230725 Mar 1, 2024
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