Skip to content

Commit b7dff42

Browse files
committed
PR feedback
1 parent 3aef500 commit b7dff42

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

tools/swift-inspect/Sources/SwiftInspectLinux/SymbolCache.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ public class SymbolCache {
3737
self.linkMap = try LinkMap(for: process)
3838
var symbolLookup: SymbolLookup = [:]
3939
for linkMapEntry in linkMap.entries {
40-
guard FileManager.default.fileExists(atPath: linkMapEntry.moduleName) else { continue }
41-
42-
let elfFile = try ElfFile(filePath: linkMapEntry.moduleName)
40+
guard let elfFile = try? ElfFile(filePath: linkMapEntry.moduleName) else { continue }
4341
let symbolMap = try elfFile.loadSymbols(baseAddress: linkMapEntry.baseAddress)
4442
symbolLookup[linkMapEntry.moduleName] = symbolMap
4543
}

tools/swift-inspect/Sources/swift-inspect/LinuxRemoteProcess.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
self.symbolCache = try SwiftInspectLinux.SymbolCache(for: process)
113113
self.memoryMap = try SwiftInspectLinux.MemoryMap(for: processId)
114114
} catch {
115-
fputs("failed initialization for process \(processId): \(error)\n", stderr)
115+
fatalError("failed initialization for process \(processId): \(error)")
116116
return nil
117117
}
118118

@@ -152,7 +152,7 @@
152152
}
153153

154154
internal func iterateHeap(_ body: (swift_addr_t, UInt64) -> Void) {
155-
fputs("heap iteration is not supported on Linux\n", stderr)
155+
fatalError("heap iteration is not supported on Linux")
156156
}
157157
}
158158
#endif // os(Linux)

0 commit comments

Comments
 (0)