|
| 1 | +//===----------------------------------------------------------------------===// |
| 2 | +// |
| 3 | +// This source file is part of the Swift.org open source project |
| 4 | +// |
| 5 | +// Copyright (c) 2025 Apple Inc. and the Swift project authors |
| 6 | +// Licensed under Apache License v2.0 with Runtime Library Exception |
| 7 | +// |
| 8 | +// See https://swift.org/LICENSE.txt for license information |
| 9 | +// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors |
| 10 | +// |
| 11 | +//===----------------------------------------------------------------------===// |
| 12 | + |
| 13 | +/// A command sent from a debugger host (GDB or LLDB) to a debugger target (a device |
| 14 | +/// or a virtual machine being debugged). |
1 | 15 | /// See GDB and LLDB remote protocol documentation for more details: |
2 | 16 | /// * https://sourceware.org/gdb/current/onlinedocs/gdb.html/General-Query-Packets.html |
3 | 17 | /// * https://lldb.llvm.org/resources/lldbgdbremote.html |
@@ -31,6 +45,7 @@ package struct GDBHostCommand: Equatable { |
31 | 45 |
|
32 | 46 | case generalRegisters |
33 | 47 |
|
| 48 | + /// Decodes kind of a command from a raw string sent from a host. |
34 | 49 | package init?(rawValue: String) { |
35 | 50 | switch rawValue { |
36 | 51 | case "g": |
@@ -74,8 +89,10 @@ package struct GDBHostCommand: Equatable { |
74 | 89 | } |
75 | 90 | } |
76 | 91 |
|
| 92 | + /// The kind of a host command for the target to act upon. |
77 | 93 | package let kind: Kind |
78 | 94 |
|
| 95 | + /// Arguments supplied with a host command. |
79 | 96 | package let arguments: String |
80 | 97 |
|
81 | 98 | package init(kindString: String, arguments: String) throws { |
@@ -106,6 +123,7 @@ package struct GDBHostCommand: Equatable { |
106 | 123 | self.arguments = arguments |
107 | 124 | } |
108 | 125 |
|
| 126 | + /// Memberwise initializer of `GDBHostCommand` type. |
109 | 127 | package init(kind: Kind, arguments: String) { |
110 | 128 | self.kind = kind |
111 | 129 | self.arguments = arguments |
|
0 commit comments