mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
This restructures and refactors the project to split up the implementation into smaller fragments. The majority of the operations are portable: the ones which are not require iterating the heap allocations which is not guaranteed to be a portable operation. Additionally, the `Inspector` class is renamed into `RemoteProcess` which is also converted to a protocol to allow adding in an implementation for other targets. The inspection operations are split off into individual files to make it easier to follow. Take the opportunity to use `@main` for the entry point.
35 lines
871 B
C
35 lines
871 B
C
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#if defined(__APPLE__)
|
|
|
|
#include <stdint.h>
|
|
#include <ptrauth.h>
|
|
|
|
struct CSTypeRef {
|
|
uintptr_t a, b;
|
|
};
|
|
|
|
struct Range {
|
|
uintptr_t location, length;
|
|
};
|
|
|
|
static inline uintptr_t GetPtrauthMask(void) {
|
|
#if __has_feature(ptrauth_calls)
|
|
return (uintptr_t)ptrauth_strip((void*)0x0007ffffffffffff, 0);
|
|
#else
|
|
return (uintptr_t)~0ull;
|
|
#endif
|
|
}
|
|
|
|
#endif
|