On Linux specifically, it was possible for it to return `nil` to signal
the end of the unwind, then subsequently return non-`nil` again. That
violates the expectations of the code layered above it, and can cause
an "Index out of range" error to occur.
rdar://112534548
This seems to be happening because we're hitting an invalid frame
on the stack where the program counter value is read back as zero.
If we find one of those, treat it as the end of our stack walk.
rdar://110846253
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
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