@@ -18,7 +18,6 @@ import Swift
18
18
19
19
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
20
20
21
- @_implementationOnly import Darwin. Mach
22
21
@_implementationOnly import _SwiftBacktracingShims
23
22
24
23
#endif
@@ -327,20 +326,20 @@ public struct Backtrace: CustomStringConvertible, Sendable {
327
326
/// @returns A list of `Image`s.
328
327
public static func captureImages( ) -> [ Image ] {
329
328
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
330
- return captureImages ( for: mach_task_self_ )
329
+ return captureImages ( for: _swift_backtrace_task_self ( ) )
331
330
#else
332
331
return [ ]
333
332
#endif
334
333
}
335
334
336
335
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
337
- private static func withDyldProcessInfo< T> ( for task: task_t ,
336
+ private static func withDyldProcessInfo< T> ( for task: __swift_task_t ,
338
337
fn: ( OpaquePointer ? ) throws -> T )
339
338
rethrows -> T {
340
- var kret : kern_return_t = KERN_SUCCESS
339
+ var kret = __swift_kern_return_t ( _SWIFT_KERN_SUCCESS )
341
340
let dyldInfo = _dyld_process_info_create ( task, 0 , & kret)
342
341
343
- if kret != KERN_SUCCESS {
342
+ if kret != _SWIFT_KERN_SUCCESS {
344
343
fatalError ( " error: cannot create dyld process info " )
345
344
}
346
345
@@ -357,7 +356,7 @@ public struct Backtrace: CustomStringConvertible, Sendable {
357
356
var images : [ Image ] = [ ]
358
357
359
358
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
360
- let task = process as! task_t
359
+ let task = process as! __swift_task_t
361
360
362
361
withDyldProcessInfo ( for: task) { dyldInfo in
363
362
_dyld_process_info_for_each_image ( dyldInfo) {
@@ -366,7 +365,7 @@ public struct Backtrace: CustomStringConvertible, Sendable {
366
365
if let path = path, let uuid = uuid {
367
366
let pathString = String ( cString: path)
368
367
let theUUID = Array ( UnsafeBufferPointer ( start: uuid,
369
- count: MemoryLayout< uuid_t > . size) )
368
+ count: MemoryLayout< __swift_uuid_t > . size) )
370
369
let name : String
371
370
if let slashIndex = pathString. lastIndex ( of: " / " ) {
372
371
name = String ( pathString. suffix ( from:
@@ -404,7 +403,7 @@ public struct Backtrace: CustomStringConvertible, Sendable {
404
403
/// @returns A `SharedCacheInfo`.
405
404
public static func captureSharedCacheInfo( ) -> SharedCacheInfo ? {
406
405
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
407
- return captureSharedCacheInfo ( for: mach_task_self_ )
406
+ return captureSharedCacheInfo ( for: _swift_backtrace_task_self ( ) )
408
407
#else
409
408
return nil
410
409
#endif
@@ -413,13 +412,13 @@ public struct Backtrace: CustomStringConvertible, Sendable {
413
412
@_spi ( Internal)
414
413
public static func captureSharedCacheInfo( for t: Any ) -> SharedCacheInfo ? {
415
414
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
416
- let task = t as! task_t
415
+ let task = t as! __swift_task_t
417
416
return withDyldProcessInfo ( for: task) { dyldInfo in
418
417
var cacheInfo = dyld_process_cache_info ( )
419
418
_dyld_process_info_get_cache ( dyldInfo, & cacheInfo)
420
419
let theUUID = withUnsafePointer ( to: cacheInfo. cacheUUID) {
421
420
Array ( UnsafeRawBufferPointer ( start: $0,
422
- count: MemoryLayout< uuid_t > . size) )
421
+ count: MemoryLayout< __swift_uuid_t > . size) )
423
422
}
424
423
return SharedCacheInfo ( uuid: theUUID,
425
424
baseAddress: Address ( cacheInfo. cacheBaseAddress) ,
0 commit comments