Skip to content

Commit ac70bf7

Browse files
authored
Merge pull request #41541 from compnerd/documentation
swift-inspect: add some documentation
2 parents fa9889d + 4a64b9f commit ac70bf7

File tree

1 file changed

+41
-1
lines changed

1 file changed

+41
-1
lines changed

tools/swift-inspect/README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,43 @@
11
# swift-inspect
22

3-
A description of this package.
3+
swift-inspect is a debugging tool which allows you to inspect a live Swift process to gain insight into the runtime interactions of the application.
4+
5+
swift-inspect uses the reflection APIs to introspect the live process. It relies on the swift remote mirror library to remotely reconstruct data types.
6+
7+
### Building
8+
9+
swift-inspect can be built using [swift-package-manager](https://github.com/apple/swift-package-manager).
10+
11+
##### Windows
12+
13+
In order to build on Windows, some additional parameters must be passed to the build tool to locate the necessary libraries.
14+
15+
~~~
16+
swift build -Xcc -I%DEVELOPER_DIR%\Toolchains\unknown-Asserts-development.xctoolchain\usr\include\swift\SwiftRemoteMirror -Xlinker %DEVELOPER_DIR%\Toolchains\unknown-Asserts-development.xctoolchain\usr\lib\swift\windows\x86_64\swiftRemoteMirror.lib
17+
~~~
18+
19+
### Using
20+
21+
The following inspection operations are available currently.
22+
23+
##### All Platforms
24+
25+
dump-cache-nodes <name-or-pid>
26+
: Print the metadata cache nodes.
27+
28+
dump-conformance-cache <name-or-pid>
29+
: Print the content of the protocol conformance cache.
30+
31+
dump-generic-metadata <name-or-pid> [--backtrace] [--backtrace-long]
32+
: Print generic metadata allocations.
33+
34+
dump-raw-metadata <name-or-pid> [--backtrace] [--backtrace-long]
35+
: Print metadata allocations.
36+
37+
##### Darwin Only
38+
39+
dump-arrays <name-or-pid>
40+
: Print information about array objects in the target
41+
42+
dump-concurrency <name-or-pid>
43+
: Print information about tasks, actors, and threads under Concurrency.

0 commit comments

Comments
 (0)