Commit Graph

10 Commits

Author SHA1 Message Date
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
d6cef2c0b5 Merge pull request #64170 from al45tair/eng/PR-106276227
[Backtracing] Mark withCurrentContext() as @_transparent.
2023-03-08 08:37:59 +00:00
Alastair Houghton
7ed869e868 [Backtracing] Mark withCurrentContext() as @_transparent.
The `withCurrentContext()` methods on the `Context` structs need to be
inlined, even in debug builds, otherwise we would need to skip an extra
frame at the top of the backtrace.

This fixes test failures in debug stdlib builds.

rdar://106276227
2023-03-07 18:20:29 +00:00
Alastair Houghton
b9800fda43 Merge pull request #64102 from al45tair/backtracing/full-extra-shims
[Backtracing] Build work.
2023-03-06 20:54:27 +00:00
Alastair Houghton
4ad0a40a73 [Backtracing] Disable assembly language on ARM Windows.
On ARM Windows, we need MARMASM to assemble the context capture code,
but CMake doesn't support MARMASM until version 3.26, which isn't yet
released.

(Confusingly it appears to have partial but non-working support in the
present versions.)

rdar://106284325
2023-03-06 15:47:04 +00: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
eb38d80655 [Backtracing] Fix Windows build.
While I was doing this, it turns out Saleem was fixing things to avoid
having to patch the Windows include directories, which is awesome but
necessitates an extra change to the backtracing stuff to make the build
not fail on Windows.

rdar://105409147
2023-03-04 08:00:09 +00:00
Alastair Houghton
36c2e4c694 [Backtracing] Fix OS conditionals so iOS builds work.
Some of the `TARGET` and `os()` conditionals needed to be updated.

rdar://104336548
2023-03-04 07:56:03 +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