Let's say I have two classes, Unicorn and Rainbow. Unicorn.m is open in one tab in xcode, and I'm currently editing Rainbow.m, open in another tab. I have a breakpoint set in Unicorn.m. When I run my code, the Unicorn breakpoint gets hit, and my Rainbow tab, the tab I'm currently looking at, gets switched to Unicorn. So now I have Unicorn open in two tabs, and Rainbow open in none.
I would like for xcode to either:
a) look to see if there's currently a tab open which contains that breakpoint and if so, switch the current view to that tab
or:
b) open up a new tab
It's really annoying to me to have my current tab switched to another file. Is there any setting in xcode I can make to help me with this? Or should I submit a request to apple?
Control-click the breakpoint, choose Edit Breakpoint, and enter a condition using variables available in the local scope. The debugger evaluates the expression each time it reaches the breakpoint in execution, and pauses only if the expression is true.
New in Xcode 13, if a breakpoint is not resolved to any location by LLDB, Xcode will show you a dashed icon. There is a myriad of reasons why a breakpoint is not resolved but there are some common explanations. If you hover over the unresolved breakpoint icon, we have a tooltip that can help you out.
You might be pushing "Run" instead of "Debug" in which case your program is not running with the help of gdb, in which case you cannot expect breakpoints to work! In Xcode 6.4, there is now only a Run button and whether it runs a debug configuration or not depends on the currently selected scheme settings.
You can click on Breakpoint Navigator and click on + symbol at the bottom and select Symbolic Breakpoint as an option. Now, you can ask - This is fine for putting a break on simple variables.
I can help with b):
Open preferences -> Behaviors -> Run Pauses:
Check Show Tab and enter a Name for the new Tab you'd like to spawn when a breakpoint is reached. For this example it is Breakpoint.
Then, create a new tab by double clicking the empty area beside a tab (red arrow) or +
. On the new tab, double click the name of the tab (green arrow) or press cmd+opt+shift+T and name it, no wonder, Breakpoint.
When the breakpoint is hit it'll open the Breakpoint tab or switch to it if it's already open.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With