mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Backtracing] Add ImageMap instead of just using an Array.
We want to be able to efficiently serialise lists of images, and to do so it makes most sense to create a separate `ImageMap` type. This also provides a useful place to put methods to e.g. find an image by address or by build ID. rdar://124913332
This commit is contained in:
27
test/Backtracing/ImageMap.swift
Normal file
27
test/Backtracing/ImageMap.swift
Normal file
@@ -0,0 +1,27 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-build-swift %s -parse-as-library -Onone -o %t/ImageMap
|
||||
// RUN: %target-codesign %t/ImageMap
|
||||
// RUN: %target-run %t/ImageMap | %FileCheck %s
|
||||
|
||||
// UNSUPPORTED: use_os_stdlib
|
||||
// UNSUPPORTED: back_deployment_runtime
|
||||
// REQUIRES: executable_test
|
||||
// REQUIRES: backtracing
|
||||
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||
|
||||
import Runtime
|
||||
|
||||
@main
|
||||
struct ImageMapTest {
|
||||
static func main() {
|
||||
let map = ImageMap.capture()
|
||||
|
||||
// We expect ImageMap, followed by one or more additional lines
|
||||
|
||||
// CHECK: {{0x[0-9a-f]*-0x[0-9a-f]*}} {{(<no build ID>|[0-9a-f]*)}} ImageMap {{.*}}/ImageMap
|
||||
// CHECK-NEXT: {{0x[0-9a-f]*-0x[0-9a-f]*}} {{(<no build ID>|[0-9a-f]*)}} [[NAME:[^ ]*]] {{.*}}/[[NAME]]
|
||||
print(map)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user