Swift has some module maps it overlays on Linux and Windows that groups all of the C standard library headers into a single module. This doesn’t allow clang and C++ headers to layer properly with the OS/SDK modules. clang will set -fbuiltin-headers-in-system-modules as necessary for Apple SDKs, but Swift will need to pass that flag itself when required by its module maps.
The `status` argument to the `_swift_backtrace_demangle()` function
isn't especially useful, won't match behaviour on Windows, and we
actually don't use it in the Swift code that calls this SPI.
Remove it.
rdar://110261712
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
These weren't working correctly because I made the unwinder call
`_swift_task_getCurrent()`, but of course when out-of-process, it calls
that in `swift-backtrace`, which is wrong. Remove that for now.
While I'm here, I also tweaked the formatting slightly, and I noticed
that we were saying that all thunks were also system functions, which
seemed unnecessary and odd.
Plus there were a couple of extra system functions I added to make the
async crash backtraces nicer in friendly mode.
rdar://106363539
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
Just use `UInt` for `Address`. This is still the subject of some discussion
on the forums, but I haven't decided precisely what to do about it and `UInt`
makes sense for now. This also necessitated some casts elsewhere.
Improve some comments.
Made `limit` robust against silly negative values.
A couple of formatting fixes.
Don't bother supporting the macOS 10.12.2 SDK as Xcode now supports a minimum
of 10.13.
Removed some unnecessary memory rebinding.
Made `CFString` conversion slightly more efficient.
Provide the `SharedCacheInfo` fields everywhere, but make it optional all
over as well.
rdar://104336548
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