Explain symbolic breakpoints and debug Auto Layout with one

Tests debugging closed-source frameworks without source lines. A strong answer says a symbolic breakpoint stops on UIViewAlertForUnsatisfiableConstraints, then checks the backtrace or log to find the bad view.
WHAT THIS TESTS: Your understanding of LLDB and Xcode debugging beyond basic line breakpoints. Specifically, it checks if you know how to stop execution inside Apple frameworks where you do not have source code, and whether you can translate a runtime warning into actionable debugging steps. Senior engineers are expected to diagnose issues without relying solely on print statements or third-party tools.
A GOOD ANSWER COVERS: First, a crisp definition: a symbolic breakpoint is a debugger stop set on a symbol name rather than a specific file and line, so it resolves to an address at runtime. Second, the concrete Auto Layout example: you add a symbolic breakpoint for UIViewAlertForUnsatisfiableConstraints with no module restriction so LLDB catches it inside UIKit. Third, the workflow once the breakpoint hits: you inspect the backtrace to find which of your view controllers or methods added the conflicting constraints, then you look at the console output which prints the full constraint ambiguity description. Fourth, the extra trick of running po [[UIWindow keyWindow] _autolayoutTrace] or using the view debugger to visualize the hierarchy and spot the ambiguous layout. Fifth, a brief note on when to use symbolic breakpoints versus exception breakpoints, namely that symbolic breakpoints are precise to a function entry while exception breakpoints catch thrown exceptions broadly.
COMMON WRONG ANSWERS: Confusing a symbolic breakpoint with an exception breakpoint is the most frequent error. Another red flag is saying you need the source code for the symbol; symbolic breakpoints work precisely because you do not need it. Candidates who mention UIViewAlertForUnsatisfiableConstraints but cannot explain what to do after the breakpoint hits are also weak; knowing the symbol name is useless without the follow-up investigation. Finally, suggesting you would simply add a line breakpoint inside UIKit framework headers reveals a misunderstanding of how closed-source binaries ship.
LIKELY FOLLOW-UPS: The interviewer might ask how to make the breakpoint conditional, such as stopping only when a specific view is in the hierarchy. They could also ask about the module field and why you might leave it blank or set it to UIKit. Another common follow-up is how to script the breakpoint to automatically run commands like bt or po and continue, turning it into a logging probe. You might also be asked to compare symbolic breakpoints to breakpoint setters on Swift functions with module namespaces.
ONE CONCRETE EXAMPLE: Imagine a chat app where a message bubble occasionally logs an unsatisfiable constraints warning in the console but does not crash. Instead of guessing which constraint is wrong, you open the breakpoint navigator, tap plus, choose Symbolic Breakpoint, and enter UIViewAlertForUnsatisfiableConstraints with no module condition. You run the app, open the problematic thread, and the debugger pauses deep inside UIKit. You look three or four frames up the backtrace and see your ChatMessageCell configure method. In the console you see the conflicting constraints listed with their priorities and constants. You run po [[UIWindow keyWindow] _autolayoutTrace] and notice the bubble width is ambiguous because you forgot to pin the trailing edge in a reuse path. You fix the missing constraint in configure and the breakpoint no longer fires.
Source: developer.apple.com
Read the original → developer.apple.com
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.