| 204 | } |
| 205 | |
| 206 | function normalizeDebugStackFrames(items: unknown[]): unknown[] { |
| 207 | if (!items.every(isDebugStackFrameRecord)) { |
| 208 | return items; |
| 209 | } |
| 210 | |
| 211 | const firstAppFrameIndex = items.findIndex((frame) => |
| 212 | frame.displayLocation.includes('<SIM_APP_BUNDLE>/'), |
| 213 | ); |
| 214 | if (firstAppFrameIndex === -1) { |
| 215 | return items; |
| 216 | } |
| 217 | |
| 218 | const stableLaunchBoundaryIndex = items.findIndex( |
| 219 | (frame, index) => |
| 220 | index < firstAppFrameIndex && |
| 221 | frame.displayLocation.includes('GraphicsServices.framework/GraphicsServices'), |
| 222 | ); |
| 223 | if (stableLaunchBoundaryIndex <= 0) { |
| 224 | return items; |
| 225 | } |
| 226 | |
| 227 | return items.slice(stableLaunchBoundaryIndex).map((frame, index) => ({ ...frame, index })); |
| 228 | } |
| 229 | |
| 230 | function normalizeBuildSettingsEntryKey(key: string): string { |
| 231 | if (key.startsWith('SDK_DIR_')) { |