Skip to content

Conversation

augusto2112
Copy link
Contributor

This new function allows subclasses to attempt to resolve a pointer to
a symbol before any memory is read, which can be potentially expensive
(for example, in LLDB).

Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

Resolves SR-NNNN.

This new function allows subclasses to attempt to resolve a pointer to
a symbol before any memory is read, which can be potentially expensive
(for example, in LLDB).
@augusto2112
Copy link
Contributor Author

@swift-ci smoke test


/// Atempt to resolve the pointer to a symbol for the given remote address.
virtual llvm::Optional<RemoteAbsolutePointer>
resolvePointerAsSymbol(RemoteAddress address) {
Copy link
Contributor

Choose a reason for hiding this comment

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

@adrian-prantl was your suggestion that we refactor the existing one? As is, this would give two functions that do the same.

Copy link
Contributor

Choose a reason for hiding this comment

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

This variant works fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

Adrian do you mean we should add this new function and remove the old function?

The way I see it, the API doesn't need both resolvePointer and resolvePointerAsSymbol. I think this new one is the right way to model this behavior, and I think we can and should remove resolvePointer.

I also think we should attempt to give resolvePointerAsSymbol a better name. There's already getSymbolAddress, and as this function is the inverse, maybe it should be named getAddressSymbol. I think getSymbolForAddress might be most clear, but it would be confusing to have both getSymbolAddress and getSymbolForAddress. Maybe symbolForAddress?

@augusto2112 augusto2112 merged commit 2baed0e into swiftlang:main Feb 2, 2022
@augusto2112 augusto2112 deleted the resolvePointerAsSymbol branch February 2, 2022 13:31
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