Skip to content

Commit 720ca4b

Browse files
authored
Merge pull request #73138 from mikeash/symbolic-reference-lookup-better-error
[Runtime] Add the pointer location to the "failed to look up symbolic reference" error.
2 parents ae74a57 + 8498335 commit 720ca4b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

stdlib/public/runtime/MetadataLookup.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,13 @@ ResolveAsSymbolicReference::operator()(SymbolicReferenceKind kind,
133133
if (symInfo->getSymbolName())
134134
symbolName = symInfo->getSymbolName();
135135
}
136+
uintptr_t ptrLocation = detail::applyRelativeOffset(base, offset);
136137
swift::fatalError(
137138
0,
138139
"Failed to look up symbolic reference at %p - offset %" PRId32
139-
" - symbol %s in %s\n",
140-
base, offset, symbolName, fileName);
140+
" - symbol %s in %s - pointer at %#" PRIxPTR
141+
" is likely a reference to a missing weak symbol\n",
142+
base, offset, symbolName, fileName, ptrLocation);
141143
}
142144

143145
// Figure out this symbolic reference's grammatical role.

0 commit comments

Comments
 (0)