-
Couldn't load subscription status.
- Fork 19
Add basic GDB remote protocol encoding/decoding #204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
eb5f169
Basic LLDB remote protocol scaffolding
MaxDesiatov 0baf7a5
Implement more packet handling, update naming
MaxDesiatov 85a695a
Provide original license notice in `wasmkit-gdb-tool/Entrypoint.swift`
MaxDesiatov eba97a0
Apply formatter
MaxDesiatov 6546754
Make naming of types more specific to avoid future collisions
MaxDesiatov 7b2c6f6
More cleanups for type naming
MaxDesiatov 4a1c998
Remove unused `import struct Foundation.Date`
MaxDesiatov f8c08dd
Remove unused `else` clause from command decoder
MaxDesiatov 77bdb04
Add `swift-nio` in `SWIFTCI_USE_LOCAL_DEPS` clause
MaxDesiatov 256c70c
Add FIXME note for `.supportedFeatures` response
MaxDesiatov 111deb8
Use `Logger`, `NIOAsyncChannel`
MaxDesiatov e392d30
Add required dependencies to `[email protected]`
MaxDesiatov a7c62b0
Add `iSeqToWasmMapping` to `InstanceEntity`
MaxDesiatov 21e1b44
Fix formatting and iOS compatibility
MaxDesiatov 329e4f5
Update [email protected]
MaxDesiatov a3d20af
Update doc comment of `func instantiate` in `Module.swift`
MaxDesiatov 8d15b99
Add `targetStatus`/`?` host command
MaxDesiatov d9b60b1
Fix use of `OK#9a` instead of incorrect `ok#da` response
MaxDesiatov 05583d0
Add `CSystemExtras` to `[email protected]`
MaxDesiatov 39242d6
Handle `targetStatus` in `WasmKitDebugger`
MaxDesiatov cbff974
Build only `wasmkit-cli` product for WASI in `main.yml`
MaxDesiatov 982fa91
Fix formatting in `WasmKitDebugger.swift`
MaxDesiatov 3a74a91
Fix `QStartNoAckMode` handling
MaxDesiatov bc539e8
Add `qRegisterInfo` parsing to `GDBHostCommand.init`
MaxDesiatov fb4e2a2
Use `KeyValuePairs` response for `.registerInfo`
MaxDesiatov 042a2c4
Fix formatting and tests build error
MaxDesiatov 197abd3
Exclude `wasmkit-gdb-tool` on Windows, address PR feedback
MaxDesiatov a2899f7
Remove retroactive `FilePath` conformance
MaxDesiatov 0b42724
Handle more host commands, up to `qWasmCallStack`
MaxDesiatov 1783176
Fix formatting
MaxDesiatov c0a9cf6
Address PR feedback, add comment for `DebuggingAddress` sendability
MaxDesiatov 806e7ec
Add `DebuggerExecution` wrapper type
MaxDesiatov 26ea4e5
Implement `.readMemory` command handling
MaxDesiatov 8343902
Fix formatting
MaxDesiatov ff2fa0d
Pass `-package-name` in CMake to enable use of `package`
MaxDesiatov 3ed9013
Disable `WasmKitGDBHandler` on Windows
MaxDesiatov 3ea5aab
Fix formatting
MaxDesiatov 3fc8fdc
Try nightly `main` for `build-cmake` job
MaxDesiatov ea83134
Revert "Try nightly `main` for `build-cmake` job"
MaxDesiatov 2893799
Rename `DebuggerExecution` to `Debugger`, hide behind a trait
MaxDesiatov 7bdb16c
Enable `WasmDebuggingSupport` on CI where possible
MaxDesiatov 4ea0fb0
Fix formatting
MaxDesiatov ee3c7bf
Revert "Pass `-package-name` in CMake to enable use of `package`"
MaxDesiatov a6d0749
Disable traits in pre-6.1, guard use of `package` on trait
MaxDesiatov 4909d3b
Remove use of `package` from CMake-built code
MaxDesiatov cce2105
Fix non-CMake build breakage
MaxDesiatov 811589f
Fix formatting
MaxDesiatov bc2230d
Enable iseq -> wasm instruction mapping
MaxDesiatov db1ec2d
Fix formatting
MaxDesiatov 62592f1
Add missing `mutating` to `Debugger.swift`
MaxDesiatov bbfcb45
Make `init` throw effect untyped in `Debugger.swift`
MaxDesiatov c6213eb
Make throwing method effects untyped in `Debugger.swift`
MaxDesiatov a993b50
Make `debugger: Debugger` property mutable
MaxDesiatov 2d065e0
Clean up `WasmGen` code
MaxDesiatov fd0d1ee
Add reverse wasm->iseq mapping, breakpoints toggling PoC
MaxDesiatov a35b73e
Remove unused `functionAddresses` property from `Debugger`
MaxDesiatov 16ac0cf
Remove changes unrelated to the protocol
MaxDesiatov 410c470
Clarify licensing in `README.md`
MaxDesiatov 977b939
Add license files for separate modules
MaxDesiatov 2acd4f3
Basic doc comments for `GDBHostCommand`
MaxDesiatov 3b2e30f
Add doc comments for `GDBHostCommandDecoder`
MaxDesiatov fc740e5
Add remaining doc comments
MaxDesiatov a297f2d
Fix formatting
MaxDesiatov ff2e940
Fix var naming typo
MaxDesiatov f6bab20
Remove unused `throws` in `GDBTargetResponseEncoder.swift`
MaxDesiatov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "swiftPM": { | ||
| "traits": ["WasmDebuggingSupport"] | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,193 @@ | ||
| // swift-tools-version:6.1 | ||
|
|
||
| import PackageDescription | ||
|
|
||
| import class Foundation.ProcessInfo | ||
|
|
||
| let DarwinPlatforms: [Platform] = [.macOS, .iOS, .watchOS, .tvOS, .visionOS] | ||
|
|
||
| let package = Package( | ||
| name: "WasmKit", | ||
| platforms: [.macOS(.v15), .iOS(.v17)], | ||
| products: [ | ||
| .executable(name: "wasmkit-cli", targets: ["CLI"]), | ||
| .library(name: "WasmKit", targets: ["WasmKit"]), | ||
| .library(name: "WasmKitWASI", targets: ["WasmKitWASI"]), | ||
| .library(name: "WASI", targets: ["WASI"]), | ||
| .library(name: "WasmParser", targets: ["WasmParser"]), | ||
| .library(name: "WAT", targets: ["WAT"]), | ||
| .library(name: "WIT", targets: ["WIT"]), | ||
| .library(name: "_CabiShims", targets: ["_CabiShims"]), | ||
| ], | ||
| traits: [ | ||
| .default(enabledTraits: []), | ||
| "WasmDebuggingSupport" | ||
| ], | ||
| targets: [ | ||
| .executableTarget( | ||
| name: "CLI", | ||
| dependencies: [ | ||
| "WAT", | ||
| "WasmKit", | ||
| "WasmKitWASI", | ||
| .product(name: "ArgumentParser", package: "swift-argument-parser"), | ||
| .product(name: "SystemPackage", package: "swift-system"), | ||
| ], | ||
| exclude: ["CMakeLists.txt"] | ||
| ), | ||
|
|
||
| .target( | ||
| name: "WasmKit", | ||
| dependencies: [ | ||
| "_CWasmKit", | ||
| "WasmParser", | ||
| "WasmTypes", | ||
| "SystemExtras", | ||
| .product(name: "SystemPackage", package: "swift-system"), | ||
| ], | ||
| exclude: ["CMakeLists.txt"] | ||
| ), | ||
| .target(name: "_CWasmKit"), | ||
| .target( | ||
| name: "WasmKitFuzzing", | ||
| dependencies: ["WasmKit"], | ||
| path: "FuzzTesting/Sources/WasmKitFuzzing" | ||
| ), | ||
| .testTarget( | ||
| name: "WasmKitTests", | ||
| dependencies: ["WasmKit", "WAT", "WasmKitFuzzing"], | ||
| exclude: ["ExtraSuite"] | ||
| ), | ||
|
|
||
| .target( | ||
| name: "WAT", | ||
| dependencies: ["WasmParser"], | ||
| exclude: ["CMakeLists.txt"] | ||
| ), | ||
| .testTarget(name: "WATTests", dependencies: ["WAT"]), | ||
|
|
||
| .target( | ||
| name: "WasmParser", | ||
| dependencies: [ | ||
| "WasmTypes", | ||
| .product(name: "SystemPackage", package: "swift-system"), | ||
| ], | ||
| exclude: ["CMakeLists.txt"] | ||
| ), | ||
| .testTarget(name: "WasmParserTests", dependencies: ["WasmParser"]), | ||
|
|
||
| .target(name: "WasmTypes", exclude: ["CMakeLists.txt"]), | ||
|
|
||
| .target( | ||
| name: "WasmKitWASI", | ||
| dependencies: ["WasmKit", "WASI"], | ||
| exclude: ["CMakeLists.txt"] | ||
| ), | ||
| .target( | ||
| name: "WASI", | ||
| dependencies: ["WasmTypes", "SystemExtras"], | ||
| exclude: ["CMakeLists.txt"] | ||
| ), | ||
| .testTarget(name: "WASITests", dependencies: ["WASI", "WasmKitWASI"]), | ||
|
|
||
| .target( | ||
| name: "SystemExtras", | ||
| dependencies: [ | ||
| .product(name: "SystemPackage", package: "swift-system"), | ||
| .target(name: "CSystemExtras", condition: .when(platforms: [.wasi])), | ||
| ], | ||
| exclude: ["CMakeLists.txt"], | ||
| swiftSettings: [ | ||
| .define("SYSTEM_PACKAGE_DARWIN", .when(platforms: DarwinPlatforms)) | ||
| ] | ||
| ), | ||
|
|
||
| .target(name: "CSystemExtras"), | ||
|
|
||
| .executableTarget( | ||
| name: "WITTool", | ||
| dependencies: [ | ||
| "WIT", | ||
| "WITOverlayGenerator", | ||
| "WITExtractor", | ||
| .product(name: "ArgumentParser", package: "swift-argument-parser"), | ||
| ] | ||
| ), | ||
|
|
||
| .target(name: "WIT"), | ||
| .testTarget(name: "WITTests", dependencies: ["WIT"]), | ||
|
|
||
| .target(name: "WITOverlayGenerator", dependencies: ["WIT"]), | ||
| .target(name: "_CabiShims"), | ||
|
|
||
| .target(name: "WITExtractor"), | ||
| .testTarget(name: "WITExtractorTests", dependencies: ["WITExtractor", "WIT"]), | ||
|
|
||
| .target(name: "GDBRemoteProtocol", | ||
| dependencies: [ | ||
| .product(name: "Logging", package: "swift-log"), | ||
| .product(name: "NIOCore", package: "swift-nio"), | ||
| ] | ||
| ), | ||
| .testTarget(name: "GDBRemoteProtocolTests", dependencies: ["GDBRemoteProtocol"]), | ||
| ], | ||
| ) | ||
|
|
||
| if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { | ||
| package.dependencies += [ | ||
| .package(url: "https://github.com/apple/swift-argument-parser", from: "1.5.1"), | ||
| .package(url: "https://github.com/apple/swift-system", from: "1.5.0"), | ||
| .package(url: "https://github.com/apple/swift-nio", from: "2.86.2"), | ||
| .package(url: "https://github.com/apple/swift-log", from: "1.6.4"), | ||
| ] | ||
| } else { | ||
| package.dependencies += [ | ||
| .package(path: "../swift-argument-parser"), | ||
| .package(path: "../swift-system"), | ||
MaxDesiatov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| .package(path: "../swift-nio"), | ||
| .package(path: "../swift-log"), | ||
| ] | ||
| } | ||
|
|
||
| #if !os(Windows) | ||
| // Add build tool plugins only for non-Windows platforms | ||
| package.products.append(contentsOf: [ | ||
| .plugin(name: "WITOverlayPlugin", targets: ["WITOverlayPlugin"]), | ||
| .plugin(name: "WITExtractorPlugin", targets: ["WITExtractorPlugin"]), | ||
| ]) | ||
|
|
||
| package.targets.append(contentsOf: [ | ||
| .plugin(name: "WITOverlayPlugin", capability: .buildTool(), dependencies: ["WITTool"]), | ||
| .plugin(name: "GenerateOverlayForTesting", capability: .buildTool(), dependencies: ["WITTool"]), | ||
| .testTarget( | ||
| name: "WITOverlayGeneratorTests", | ||
| dependencies: ["WITOverlayGenerator", "WasmKit", "WasmKitWASI"], | ||
| exclude: ["Fixtures", "Compiled", "Generated", "EmbeddedSupport"], | ||
| plugins: [.plugin(name: "GenerateOverlayForTesting")] | ||
| ), | ||
| .plugin( | ||
| name: "WITExtractorPlugin", | ||
| capability: .command( | ||
| intent: .custom(verb: "extract-wit", description: "Extract WIT definition from Swift module"), | ||
| permissions: [] | ||
| ), | ||
| dependencies: ["WITTool"] | ||
| ), | ||
| .testTarget( | ||
| name: "WITExtractorPluginTests", | ||
| exclude: ["Fixtures"] | ||
| ), | ||
|
|
||
| .target( | ||
| name: "WasmKitGDBHandler", | ||
| dependencies: [ | ||
| .product(name: "_NIOFileSystem", package: "swift-nio"), | ||
| .product(name: "NIOCore", package: "swift-nio"), | ||
| .product(name: "SystemPackage", package: "swift-system"), | ||
| "WasmKit", | ||
| "WasmKitWASI", | ||
| "GDBRemoteProtocol", | ||
| ], | ||
| ), | ||
| ]) | ||
| #endif | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added separate
Package.swiftmanifest to hide debugger support behind a trait for now, and traits aren't supported in 6.0.