File tree Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Expand file tree Collapse file tree 2 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -152,6 +152,28 @@ final class DyldCachePrintTests: XCTestCase {
152
152
}
153
153
}
154
154
155
+ func testLocalSymbolsInSymbolCache( ) throws {
156
+ guard let symbolCache = try cache. symbolCache else {
157
+ return
158
+ }
159
+ guard let info = symbolCache. localSymbolsInfo else {
160
+ return
161
+ }
162
+ let machO = cache. machOFiles ( ) . first (
163
+ where: {
164
+ $0. imagePath. contains ( " /SwiftUICore " )
165
+ }
166
+ ) !
167
+ guard let entry = info. entry ( for: machO, in: symbolCache) else {
168
+ XCTFail ( " No entry found " )
169
+ return
170
+ }
171
+ let symbols = Array ( info. symbols ( in: symbolCache) ) [ entry. nlistRange]
172
+ for symbol in symbols. prefix ( 100 ) {
173
+ print ( symbol. name)
174
+ }
175
+ }
176
+
155
177
func testMachOFiles( ) throws {
156
178
let machOs = cache. machOFiles ( )
157
179
for machO in machOs {
Original file line number Diff line number Diff line change @@ -148,6 +148,28 @@ final class FullDyldCachePrintTests: XCTestCase {
148
148
}
149
149
}
150
150
151
+ func testLocalSymbolsInSymbolCache( ) throws {
152
+ guard let symbolCache = try cache. symbolCache else {
153
+ return
154
+ }
155
+ guard let info = symbolCache. localSymbolsInfo else {
156
+ return
157
+ }
158
+ let machO = cache. machOFiles ( ) . first (
159
+ where: {
160
+ $0. imagePath. contains ( " /SwiftUICore " )
161
+ }
162
+ ) !
163
+ guard let entry = info. entry ( for: machO, in: symbolCache) else {
164
+ XCTFail ( " No entry found " )
165
+ return
166
+ }
167
+ let symbols = Array ( info. symbols ( in: symbolCache) ) [ entry. nlistRange]
168
+ for symbol in symbols. prefix ( 100 ) {
169
+ print ( symbol. name)
170
+ }
171
+ }
172
+
151
173
func testMachOFiles( ) throws {
152
174
let machOs = cache. machOFiles ( )
153
175
for machO in machOs {
You can’t perform that action at this time.
0 commit comments