[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:
Alastair Houghton
2024-11-15 12:36:38 +00:00
parent 760cc57bef
commit 0e3e9efcd3
16 changed files with 1501 additions and 224 deletions

View File

@@ -69,7 +69,7 @@ class Target {
var crashingThread: TargetThread.ThreadID
var task: task_t
var images: [Backtrace.Image] = []
var images: ImageMap
var threads: [TargetThread] = []
var crashingThreadNdx: Int = -1
@@ -193,7 +193,7 @@ class Target {
mcontext = mctx
images = Backtrace.captureImages(for: task)
images = ImageMap.capture(for: task)
fetchThreads(limit: limit, top: top, cache: cache, symbolicate: symbolicate)
}