Files
swift-mirror/tools/swift-inspect/Sources/SymbolicationShims/SymbolicationShims.h
Saleem Abdulrasool eef3a8f60a swift-inspect: restructure the project for porting
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.
2022-02-18 12:58:11 -08:00

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