Skip to content

Commit d2d5ad6

Browse files
Merge pull request #79111 from al45tair/eng/PR-144045984
[Backtracing] Local|RemoteMemoryReader only exists on macOS and Linux.
2 parents 615f884 + a60dd8f commit d2d5ad6

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

stdlib/public/RuntimeModule/Elf.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1879,7 +1879,9 @@ typealias Elf64Image = ElfImage<Elf64Traits>
18791879
/// Test if there is a valid ELF image at the specified address; if there is,
18801880
/// extract the address range for the text segment and the UUID, if any.
18811881
@_specialize(kind: full, where R == UnsafeLocalMemoryReader)
1882+
#if os(macOS) || os(Linux)
18821883
@_specialize(kind: full, where R == RemoteMemoryReader)
1884+
#endif
18831885
#if os(Linux)
18841886
@_specialize(kind: full, where R == MemserverMemoryReader)
18851887
#endif
@@ -1915,8 +1917,10 @@ func getElfImageInfo<R: MemoryReader>(at address: R.Address,
19151917

19161918
@_specialize(kind: full, where R == UnsafeLocalMemoryReader, Traits == Elf32Traits)
19171919
@_specialize(kind: full, where R == UnsafeLocalMemoryReader, Traits == Elf64Traits)
1920+
#if os(macOS) || os(Linux)
19181921
@_specialize(kind: full, where R == RemoteMemoryReader, Traits == Elf32Traits)
19191922
@_specialize(kind: full, where R == RemoteMemoryReader, Traits == Elf64Traits)
1923+
#endif
19201924
#if os(Linux)
19211925
@_specialize(kind: full, where R == MemserverMemoryReader, Traits == Elf32Traits)
19221926
@_specialize(kind: full, where R == MemserverMemoryReader, Traits == Elf64Traits)

stdlib/public/RuntimeModule/FramePointerUnwinder.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ public struct FramePointerUnwinder<C: Context, M: MemoryReader>: Sequence, Itera
3636
var reader: MemoryReader
3737

3838
@_specialize(exported: true, kind: full, where C == HostContext, M == UnsafeLocalMemoryReader)
39+
#if os(macOS) || os(Linux)
3940
@_specialize(exported: true, kind: full, where C == HostContext, M == RemoteMemoryReader)
41+
#endif
4042
#if os(Linux)
4143
@_specialize(exported: true, kind: full, where C == HostContext, M == MemserverMemoryReader)
4244
#endif
@@ -77,7 +79,9 @@ public struct FramePointerUnwinder<C: Context, M: MemoryReader>: Sequence, Itera
7779
}
7880

7981
@_specialize(exported: true, kind: full, where C == HostContext, M == UnsafeLocalMemoryReader)
82+
#if os(macOS) || os(Linux)
8083
@_specialize(exported: true, kind: full, where C == HostContext, M == RemoteMemoryReader)
84+
#endif
8185
#if os(Linux)
8286
@_specialize(exported: true, kind: full, where C == HostContext, M == MemserverMemoryReader)
8387
#endif
@@ -114,7 +118,9 @@ public struct FramePointerUnwinder<C: Context, M: MemoryReader>: Sequence, Itera
114118
}
115119

116120
@_specialize(exported: true, kind: full, where C == HostContext, M == UnsafeLocalMemoryReader)
121+
#if os(macOS) || os(Linux)
117122
@_specialize(exported: true, kind: full, where C == HostContext, M == RemoteMemoryReader)
123+
#endif
118124
#if os(Linux)
119125
@_specialize(exported: true, kind: full, where C == HostContext, M == MemserverMemoryReader)
120126
#endif
@@ -129,7 +135,9 @@ public struct FramePointerUnwinder<C: Context, M: MemoryReader>: Sequence, Itera
129135
}
130136

131137
@_specialize(exported: true, kind: full, where C == HostContext, M == UnsafeLocalMemoryReader)
138+
#if os(macOS) || os(Linux)
132139
@_specialize(exported: true, kind: full, where C == HostContext, M == RemoteMemoryReader)
140+
#endif
133141
#if os(Linux)
134142
@_specialize(exported: true, kind: full, where C == HostContext, M == MemserverMemoryReader)
135143
#endif
@@ -138,7 +146,9 @@ public struct FramePointerUnwinder<C: Context, M: MemoryReader>: Sequence, Itera
138146
}
139147

140148
@_specialize(exported: true, kind: full, where C == HostContext, M == UnsafeLocalMemoryReader)
149+
#if os(macOS) || os(Linux)
141150
@_specialize(exported: true, kind: full, where C == HostContext, M == RemoteMemoryReader)
151+
#endif
142152
#if os(Linux)
143153
@_specialize(exported: true, kind: full, where C == HostContext, M == MemserverMemoryReader)
144154
#endif
@@ -155,7 +165,9 @@ public struct FramePointerUnwinder<C: Context, M: MemoryReader>: Sequence, Itera
155165
}
156166

157167
@_specialize(exported: true, kind: full, where C == HostContext, M == UnsafeLocalMemoryReader)
168+
#if os(macOS) || os(Linux)
158169
@_specialize(exported: true, kind: full, where C == HostContext, M == RemoteMemoryReader)
170+
#endif
159171
#if os(Linux)
160172
@_specialize(exported: true, kind: full, where C == HostContext, M == MemserverMemoryReader)
161173
#endif

0 commit comments

Comments
 (0)