Why can't I step into SwiftUI code?

Was trying to figure out how to do plural localization with SwiftUI.Text, crash inside this:

Text("My dog \("Paula") ate \(2) and \(0)")

so set breakpoint there and single step into went nowhere, just stay on this line and eventually crash again as expected. Didn't get to see what was crashing. Why can't go into whatever inside?

1 Like

SwiftUI is a private Apple framework, and no code is provided. In order for the debugger to step into, it needs the source code, which is not present on your machine. It probably crashed because the source code is not present, and the debugging symbols have been stripped from the release version of the framework, so, for example, the debugger could have been trying to look for the source code file, line number, etc., and those symbols are not present in the stripped framework.

A crash in the debugger is a bug, so you should report it with an example that reproduces the crash. However, @jonprescott's explanation for why you can't debug into SwiftUI is correct.

1 Like

It crash because I did something wrong in Localizable.stringsdict, nothing wrong with the debugger. I was hoping to see what exactly causing the crash inside SwiftUI.Text with the debugger.

But why can't it step into assembly code? It's like something is explicitly telling the debugger not to step inside.