Commit Graph

14 Commits

Author SHA1 Message Date
Alastair Houghton
583a2f8df4 [Backtracing] Update JSON output slightly after review.
Always put `registers` in the thread record, and always use the `threads`
top level key, even if we ask for only the crashed thread.  Also add an
`omittedThreads` key.

rdar://121430255
2025-02-26 14:12:21 +00:00
Alastair Houghton
9fdbbc7e22 Update docs/Backtracing.rst
Fix a typo.

Co-authored-by: Honza Dvorsky <honza@apple.com>
2025-02-26 14:12:21 +00:00
Alastair Houghton
20685b991d [Docs] Update backtracing documentation.
Added documentation for the JSON output.

rdar://121430255
2025-02-26 14:12:20 +00:00
Alastair Houghton
0bc76dae80 [Backtracing] Add warning suppression option, enable it for tests.
The backtracing code will warn you if you attempt to forcibly enable
backtracing for a privileged executable.  This is apparently upsetting
the Driver/filelists.swift test.

Since we want to force it on for tests, so that we will definitely get
backtraces, add an option to suppress warning messages, and turn that
on for tests as well.

rdar://144497613
2025-02-24 12:55:16 +00:00
Alastair Houghton
0e3e9efcd3 [Backtracing] Add ImageMap instead of just using an Array.
We want to be able to efficiently serialise lists of images, and to do so
it makes most sense to create a separate `ImageMap` type.  This also provides
a useful place to put methods to e.g. find an image by address or by build
ID.

rdar://124913332
2025-01-17 10:09:36 +00:00
Alastair Houghton
760cc57bef [Backtracing] Rename _Backtracing to Runtime.
Move the backtracing code into a new Runtime module.  This means renaming
the Swift Runtime's CMake target because otherwise there will be a name
clash.

rdar://124913332
2025-01-17 10:09:36 +00:00
Alastair Houghton
dd0b826235 [Runtime] Improved symbolication option for backtracing.
Rather than just on or off, I've changed it to allow "off", "fast",
or "full".  "fast" means that we'll do symbol lookup, but we won't
try to find inline frames and we won't run line number programs
(those are the things that are taking considerable time in some
cases).

rdar://122302117
2024-02-06 17:38:20 +00:00
Alastair Houghton
6c7aeeb5f2 [Docs] Updated Backtracing docs with new symbolicate setting.
Document the new `symbolicate` setting.

rdar://122302117
2024-02-05 13:05:11 +00:00
Alastair Houghton
f9aeb57880 [Docs] Added a description of the platform and arch path components.
Describe what `<platform>` and `<arch>` mean in the search paths
for the `swift-backtrace` binary.

rdar://117679284
2023-11-02 11:06:51 +00:00
Alastair Houghton
27641cb402 [Docs] Update backtracing documentation for Linux.
Update the backtracing documentation with details on static linking,
frame pointer usage and a couple of other matters.

rdar://117679284
2023-10-30 10:34:25 +00:00
Alastair Houghton
9209bdd8c4 [Backtracing] Add an option to output to stderr.
In CI, it would be better if the backtraces went to stderr rather than
stdout, so provide an option for that.

rdar://107192120
2023-03-24 17:13:52 +00:00
Alastair Houghton
43ac069ad0 [Backtracing] Add control over symbol caching.
Some symbolication frameworks have a symbol cache; we probably don't want
to use that for test cases, to avoid running into problems where the cache
holds stale information.

rdar://105409147
2023-03-04 08:00:09 +00:00
Alastair Houghton
662c80eade [Backtracing][Docs] Add some information about signal handlers for macOS.
Added a list of handled signals and some notes on what the runtime will
do if it finds signal handlers already configured.

rdar://105394365
2023-03-04 08:00:09 +00:00
Alastair Houghton
24932f2ec1 [Backtracing][Docs] Add an explanation of the workings of the backtracer.
Add some discussion of how the new external backtracer works and what
options are available.

rdar://105394365
2023-03-04 08:00:09 +00:00