Skip to content

Commit bdb3cea

Browse files
committed
Fix formatting and tests build error
1 parent b846ea7 commit bdb3cea

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

Sources/GDBRemoteProtocol/GDBHostCommand.swift

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// See GDB and LLDB remote protocol documentation for more details:
22
/// * https://sourceware.org/gdb/current/onlinedocs/gdb.html/General-Query-Packets.html
33
/// * https://lldb.llvm.org/resources/lldbgdbremote.html
4-
package struct GDBHostCommand {
4+
package struct GDBHostCommand: Equatable {
55
enum Error: Swift.Error {
66
case unexpectedArgumentsValue
77
case unknownCommand(kind: String, arguments: String)
@@ -67,22 +67,27 @@ package struct GDBHostCommand {
6767

6868
package let arguments: String
6969

70-
package init(kind: String, arguments: String) throws {
70+
package init(kindString: String, arguments: String) throws {
7171
let registerInfoPrefix = "qRegisterInfo"
72-
if kind.starts(with: registerInfoPrefix) {
72+
if kindString.starts(with: registerInfoPrefix) {
7373
self.kind = .registerInfo
7474

7575
guard arguments.isEmpty else {
7676
throw Error.unexpectedArgumentsValue
7777
}
78-
self.arguments = String(kind.dropFirst(registerInfoPrefix.count))
78+
self.arguments = String(kindString.dropFirst(registerInfoPrefix.count))
7979
return
80-
} else if let kind = Kind(rawValue: kind) {
80+
} else if let kind = Kind(rawValue: kindString) {
8181
self.kind = kind
8282
} else {
83-
throw Error.unknownCommand(kind: kind, arguments: arguments)
83+
throw Error.unknownCommand(kind: kindString, arguments: arguments)
8484
}
8585

86-
self.arguments = arguments
86+
self.arguments = arguments
87+
}
88+
89+
package init(kind: Kind, arguments: String) {
90+
self.kind = kind
91+
self.arguments = arguments
8792
}
8893
}

Sources/GDBRemoteProtocol/GDBHostCommandDecoder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ package struct GDBHostCommandDecoder: ByteToMessageDecoder {
125125
}
126126

127127
let payload = try GDBHostCommand(
128-
kind: String(decoding: self.accummulatedKind, as: UTF8.self),
128+
kindString: String(decoding: self.accummulatedKind, as: UTF8.self),
129129
arguments: String(decoding: self.accummulatedArguments, as: UTF8.self)
130130
)
131131

Sources/WasmKitGDBHandler/WasmKitDebugger.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ package actor WasmKitDebugger {
7979
"set": "General Purpose Registers",
8080
"gcc": "16",
8181
"dwarf": "16",
82-
"generic": "pc"
82+
"generic": "pc",
8383
])
8484
} else {
8585
.raw("E45")

0 commit comments

Comments
 (0)