Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent Xcode from changing the contents of a tab when a breakpoint is hit

Tags:

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?

like image 359
morgancodes Avatar asked May 10 '11 16:05

morgancodes


People also ask

How do I set a conditional breakpoint in Xcode?

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.

What does a dotted breakpoint mean in Xcode?

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.

Why breakpoints are not working in Xcode?

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.

How do I use symbolic breakpoints in Xcode?

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.


1 Answers

I can help with b):

Open preferences -> Behaviors -> Run Pauses:

enter image description here

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.

enter image description here

When the breakpoint is hit it'll open the Breakpoint tab or switch to it if it's already open.

like image 122
Nick Weaver Avatar answered Sep 20 '22 18:09

Nick Weaver