Skip to content

Commit af06906

Browse files
committed
Roll back to use of Swift 6.1
1 parent 59a2e8e commit af06906

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:6.2
1+
// swift-tools-version:6.1
22

33
import PackageDescription
44

Sources/WasmKit/Execution/Debugger.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299
throw Error.stackFrameIndexOOB(frameIndex)
300300
}
301301

302-
package func readLinearMemory<T>(address: UInt, length: UInt, reader: (RawSpan) -> T) throws(Error) -> T {
302+
package func readLinearMemory<T>(address: UInt, length: UInt, reader: (UnsafeRawBufferPointer) -> T) throws(Error) -> T {
303303
guard let md, ms > 0 else {
304304
throw Error.linearMemoryNotInitialized
305305
}
@@ -312,9 +312,8 @@
312312
}
313313

314314
let memory = UnsafeRawBufferPointer(start: md, count: ms)
315-
print(Array(memory[range]))
316315

317-
return reader(UnsafeRawBufferPointer(rebasing: memory[range]).bytes)
316+
return reader(UnsafeRawBufferPointer(rebasing: memory[range]))
318317
}
319318

320319
/// Array of addresses in the Wasm binary of executed instructions on the call stack.

Sources/WasmKitGDBHandler/DebuggerMemoryCache.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,9 @@
4444

4545
return wasmBinary.readableBytesView[codeAddress..<(codeAddress + length)]
4646
} else {
47-
return try debugger.readLinearMemory(address: UInt(addressInProtocolSpace), length: length) { span in
48-
var buffer = self.allocator.buffer(capacity: span.byteCount)
49-
span.withUnsafeBytes {
50-
print(Array($0))
51-
}
52-
buffer.writeBytes(span)
47+
return try debugger.readLinearMemory(address: UInt(addressInProtocolSpace), length: length) {
48+
var buffer = self.allocator.buffer(capacity: $0.count)
49+
buffer.writeBytes($0)
5350
return buffer.readableBytesView
5451
}
5552
}

0 commit comments

Comments
 (0)