Commit Graph

7 Commits

Author SHA1 Message Date
Alastair Houghton
9aac812dc7 [Backtracing] Fix a few niggles.
It turns out that .copyBytes() checks that the source doesn't provide more
bytes than the destination will accept.

rdar://117681625
2023-11-03 14:36:22 +00:00
Alastair Houghton
1fc2ca35e8 [Backtracing] Add a caching wrapper for MemoryReader.
Currently we read many small chunks from the process we're backtracing.
If it so happens that it's the local process, that isn't really a big
problem, but if it's a remote process, especially on Linux where we have
to use the memory server, it's probably a little slow.

Fix by adding a caching layer.

rdar://117681625
2023-11-03 14:36:19 +00:00
Alastair Houghton
8d9138412d [Backtracing][Linux] Work correctly in the presence of partial reads.
There's a chance that pipes might perform a partial read; we should
handle that case.

rdar://110261712
2023-06-06 18:22:32 +01:00
Alastair Houghton
438ab7fa29 [Backtracing][Linux] Add Linux support to the _Backtracing module.
Use the new module structure rather the old SwiftShims header.  This
is much cleaner and lets us include operating system headers to get
the relevant definitions where possible.

Add code to support ELF and DWARF, including decompression using
zlib, zstd and liblzma if those turn out to be required and available.

rdar://110261712
2023-06-06 16:16:20 +01:00
Alastair Houghton
1258d45152 [Backtracing] Build work.
Additional shimming required for some builds, as well as a few other build
related tweaks.

rdar://106234311
2023-03-04 15:46:30 +00:00
Alastair Houghton
9e58b2c401 [Backtracing] Make this macOS only for now.
The Linux Swift compiler is ICEing when building _Backtracing, while
Windows still needs some tweaks.  In order to land this sooner, disable
this code except for macOS.
2023-03-04 08:00:09 +00:00
Alastair Houghton
6caea5386b [Backtracing] Add _Backtracing library to the build.
Adds a new swift_Backtracing library, with a corresponding _Backtracing
module, to the build.  Also add some tests.

This is not public API at this point, but will be used by the external
backtracing program, `swift-backtrace`.

rdar://104336548
2023-03-04 07:56:03 +00:00