Skip to content

Commit d5d1600

Browse files
committed
Fix build error, add debug logging
1 parent 169d406 commit d5d1600

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Sources/WasmKit/Translator.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,7 @@ struct InstructionTranslator: InstructionVisitor {
11271127
guard self.module.isDebuggable else { return }
11281128

11291129
self.iseqToWasmMapping.append((self.iseqBuilder.insertingPC.offsetFromHead, self.binaryOffset))
1130+
print("added iSeqToWasmMapping[\(self.iseqBuilder.insertingPC.offsetFromHead)] = \(self.binaryOffset)")
11301131
#endif
11311132
}
11321133

@@ -1901,13 +1902,17 @@ struct InstructionTranslator: InstructionVisitor {
19011902
}
19021903

19031904
private mutating func visitConst(_ type: ValueType, _ value: Value) {
1905+
print("in \(#function) self.binaryOffset is \(self.binaryOffset)")
1906+
1907+
// TODO: document this behavior
19041908
if let constSlotIndex = constantSlots.allocate(value) {
19051909
valueStack.pushConst(constSlotIndex, type: type)
19061910
iseqBuilder.resetLastEmission()
19071911
return
19081912
}
19091913
let value = UntypedValue(value)
19101914
let is32Bit = type == .i32 || type == .f32
1915+
print("emitting const \(value)")
19111916
if is32Bit {
19121917
pushEmit(
19131918
type,

Sources/WasmKitGDBHandler/WasmKitGDBHandler.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import NIOFileSystem
77
import SystemPackage
88
import WasmKit
9+
import WasmKitWASI
910

1011
extension BinaryInteger {
1112
init?(hexEncoded: Substring) {

0 commit comments

Comments
 (0)