Commit Graph

8 Commits

Author SHA1 Message Date
Alastair Houghton
e5680de071 [Backtracing] Security improvements.
Use `task_read_for_pid()` rather than having the crashing program pass its
own task port through.  This opts us in to additional OS security measures
surrounding the use of this call.

rdar://107362003
2023-04-12 12:48:33 +01:00
Alastair Houghton
d1f725c511 [Backtracing] Replace all the stdint types with Swift specific variants.
This is needed because we can't include `<stdint.h>` or `<inttypes.h>`
on Darwin without dragging in the Darwin package.

The previous solution was some icky `#define` nonsense.  This is
better.

rdar://106234311
2023-03-06 11:47:59 +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
a2fc8c3d69 [Backtracing] Only include libproc.h if it's present.
rdar://104336548
2023-03-04 07:56:03 +00:00
Alastair Houghton
1e71f92b8e [Backtracing] Don't try to include <libproc.h> for iOS.
iOS doesn't have <libproc.h>.  We don't need it anyway there.

rdar://104336548
2023-03-04 07:56:03 +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
Alastair Houghton
2f0e379324 [Backtracing] Needed to add some code to this header for the runtime.
In order for the runtime PR to work as a separate PR, it does need a little
bit of code in the `_SwiftBacktracing.h` header in SwiftShims.

rdar://105391747
2023-03-04 07:56:02 +00:00