Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions include/swift/Remote/MetadataReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,18 @@ class MetadataReader {
return nullptr;
}

// Check if the Reader can provide a symbol for this descriptor, and if it
// can, use that instead.
if (auto remoteAbsolutePointer =
Reader->resolvePointerAsSymbol(descriptor.getRemoteAddress())) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I assume this requires an exact match, and won't provide a value if the address is some offset past a symbol?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this requires it to be an exact match. Are you thinking of some scenario where we'd be at an offset from the symbol?

Copy link
Contributor

Choose a reason for hiding this comment

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

Right. Like if there was no symbol, but we got associated with the previous symbol. Just wanted to make sure this wouldn't give us the wrong answer in that case. Sounds like it does what we want.

auto symbol = remoteAbsolutePointer->getSymbol();
if (!symbol.empty()) {
if (auto demangledSymbol = buildContextManglingForSymbol(symbol, dem)) {
return demangledSymbol;
}
}
}

// Read the parent descriptor.
auto parentDescriptorResult = readParentContextDescriptor(descriptor);

Expand Down