How to delete breakpoints in XCode - xcode

I go to Breakpoints panel in XCode, in the 'Breakpoints' I click a breakpoint and click 'Delete', but it does not remove the breakpoint. And I try go to go to 'Project Breakpoints' and find the same breakpoint and click 'Delete'. But it still does not break the breakpoint.

Drag them out of the bar on the side and they will disappear.
You can also press the shortcut ⌘+\ while your cursor is on the line, or press ⌫ with the breakpoint selected in the navigator:

Also try ⌘+\ to toggle the breakpoint at the current line.

You can also right-click on it and select the "Delete" menu.

Related

the WATCH panel disappear when I debug my code in VS Code

There should be four panels(VARIABLES, WATCH, CALL STACK, BREAKPOINTS) on the left side, but now there is only three.
I try my best to find how to open the WATCH, but failed. I can't find related settings in View or Setting.json
Can anyone help me? Thank you!
pic1
pic2
I was able to run my application and set a break-point. Right-clicked on a variable and selected "add to watch" and the watch section appeared.
A new "run and debug" icon in the side-bar appeared as well. It appears that I accidentally dragged the watch section to the sidebar.
I was able to open the "run and debug" menu and drag the new icon off the sidebar and into the menu. My "Watch" section is now back where it should be.
Try selecting one variable of your code (double click), and then click with the right button of your mouse, and choose the option "Add To Watch" on the drop-down nenu. The Watch panel will show again.
Let me know if it worked.

XCode: placing cursor at breakpoint location on breakpoint hit

I want to remove several breakpoints along my program execution path. XCode stops at each breakpoint and I want to clear it immediately. In contrast to all other tools that I used to, Xcode does not put cursor on the line it stopped. Therefore, "toggle breakpoint" shortcut instead of clearing current breakpoint, puts breakpoint somewhere out of sight.
To clear current breakpoint I need to grab mouse or press extra shortcut before actually clearing breakpoint. It gets very annoying for several breakpoints in row.
Maybe there's workaround?
You can click inside the topmost thread in the Debug Navigator ⌘+6 to see where you stopped.
If you want to automatically skip a breakpoint or perform other actions when it's triggered you can Right-Click or Control+Click the breakpoint, choose Edit Breakpoint... then check Automatically continue after evaluating actions.

How to force visual studion to ignore all other breakpoints except one

As title, How to force visual studio to ignore all other breakpoints except one
Under the Debug Menu click Disable All Breakpoints, then right click the Break Point in question and click Enable Break Point.
With breakpoints window (Debug | Windows | Breakpoints) having focus select all (control-a), control-click the break point you want to keep (to unselect) and untick one of the selected breakpoints. All the selected breakpoints will be disabled.
Try exporting all your breakpoints then choose Delete All Breakpoints from the Debug menu.
you can then re-add your breakpoint and import your old ones when you're ready.
In addition to Astander's answer, you can bring up the debug window (Ctrl D+B), and it has an option there to Enable or disable all breakpoints matching the current Search, with the Search box just along from it. Very nifty.

What is the shortcut to skip all break-points in VS?

When I am at a breakpoint and if I want to ignore all the rest of breakpoints and move on, what shortcut should I use?
You can select "Disable All Breakpoints" from the Debug menu.
This and then continue with F5.
You could set this up as a keyboard shortcut under Tools/Options/Keyboard.
Well, you can:
delete all breakpoints using Ctrl+Shift+F9
disable all breakpoints from the ->Debug menu.
Disabling breakpoints does not have a shortcut defined, but you define your own in ->Tools->Options menu under Environment->Keyboard. Also Shift+F5 stops debugging altogether.
Ctrl+Shift+F9 will delete them all.
To disable all breakpoints - either you do it from the menu - or you go to option -> environment -> keyboard, and create a shortcut there.
Enabled / Disabled just one break point at a time with Ctrl + F9.
Though the cursor has to be on the given line of code.
By default there is no option available to Disable/Enable all breakpoints, so you need to add it. Steps to add Disable/Enable breakpoints are as :-
1) Under Tools tab select Customize.
2) Then under Commands tab, you would find 3 options(drop-downs) - Menu bar, Toolbar and Context menu.
3) So under Menu bar drop-down, scroll down and select option Debug.
4) And now under Controls section, select the command you need to add i.e here you would select command Enable All Breakpoints/Disable All Breakpoints and click Add Command.
5) Close this pop-up and boom, now you would find this option under Debug section of the main console.
No need to thank, just an upvote would work..!! :P :P
Shortcut to delete all break-points: CTRL+SHIFT+F9.

Xcode + remove all breakpoints

Is there any way to remove all the breakpoints in Xcode?
Well there's a 3 step way:
Press CMD(⌘)+7 to show all breakpoints.
In Xcode4 press CMD(⌘)+6, in Xcode3 press CMD(⌘)+ALT+B.
Select all breakpoints with CMD(⌘)+A and delete them, like deleting text, with backspace.
There's no step 3 :)
Its very easy to do in new Xcode. Just click on breakpoints Tab then select all then delete.
Xcode 10 Screenshot:
Old Xcode Screenshot:
tap. See attach image for clear reference.
In Xcode, you can also do by right clicking the project name on the breakpoints tab and then you can see the options for deleting all breakpoints including disabling and sharing breakpoints.
In Xcode 4, in the debugger console, type "breakpoint delete" or "br del" for short:
(lldb) br del
About to delete all breakpoints, do you want to do that?: [Y/n] y
All breakpoints removed. (1 breakpoints)
(lldb)
You can't rely on the GUI breakpoint list, since nothing you enter from the command line will show up there.
Other ways:
Select Breakpoints group in Groups and Files tree, click in Detail view, Command-A, Delete
Disclose Breakpoints smartgroup in Groups and Files tree, shift- or command-select breakpoints in outline, press Delete
Run > Console, when app is paused, type "delete breakpoints" and press Return
Xcode 10
The most easiest way is to do ⌘ + y to disable enable breakpoints .
There is another way
go to Xcode project navigations pane
Click on show Breakpoint navigator
Right click on the project file and select disable all break points
In Xcode 9 it's CMD(⌘) + 8 to access all breakpoints, you can also just click here:
Then you can select and delete them.
Additionally, you can customize your Toolbar and put the "Breakpoints" button there. Click this on/off will active/deactivate all breakpoints. While this doesn't remove them, it may be useful if you just don't want them to be hit for a run.
As an addition to mxg 's answer above:
in Xcode 5 it's been changed to CMD(⌘) + 7
For Xcode 5:
In ToolBar, select Navigate -> select Reveal in Project Navigator -> In Navigator area, select Show the Breakpoint Navigator.
Here, You can edit, hide/unhide, share, move the breakpoint for each and every class.
Note: Because of Xcode newbie's, am explained the steps from toolbar to show the Breakpoint Navigator.
For XCode 12:
Press CMD ⌘ + 8
Select All (CMD ⌘ + A)
Right Click and Select "Delete Breakpoints"
For XCode 12.4
Click on Debug in Toolbar
Choose Breakpoints
Then Click on Delete All Breakpoints
That's it!!
CMD(⌘) + a
CMD(⌘) + /
CMD(⌘) + /
In XCode 7 you can just drag a bp into the project view window and an X will appear, release mouse and it will be deleted.

Resources