Skip to content

Commit 068fd14

Browse files
authored
Merge pull request swiftlang#79582 from mikeash/dont-inspect-non-swift
[swift-inspect] On Darwin, don't try to inspect processes that don't have Swift.
2 parents 6c74271 + b3a430d commit 068fd14

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/swift-inspect/Sources/swift-inspect/DarwinRemoteProcess.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ internal final class DarwinRemoteProcess: RemoteProcess {
163163
self.swiftCore =
164164
CSSymbolicatorGetSymbolOwnerWithNameAtTime(self.symbolicator,
165165
"libswiftCore.dylib", kCSNow)
166+
if CSIsNull(self.swiftCore) {
167+
print("pid \(processId) does not have libswiftCore.dylib loaded")
168+
return nil
169+
}
170+
166171
self.swiftConcurrency = CSSymbolicatorGetSymbolOwnerWithNameAtTime(
167172
symbolicator, "libswift_Concurrency.dylib", kCSNow)
168173
_ = task_start_peeking(self.task)

0 commit comments

Comments
 (0)