user278859
user278859

Reputation: 10519

Debugger stopping at a non existent breakpoint in Xcode 4

Since upgrading to Xcode 4 my app stops at what I think are non existent break points. When it breaks there is no breakpoint showing in the breakpoint navigator and the editor says:

Thread:1 Stopped at breakpoint 17

Anyone else seeing this? Is this something new, maybe?

Upvotes: 13

Views: 11487

Answers (9)

fluke
fluke

Reputation: 680

Maybe it's an Xcode bug but I still have a solution.

You can use LLDB to see and manipulate all the actual breakpoints.

Just type the following commands in the lldb window:

(lldb) is the prompt.

(lldb) help    -> for help
(lldb) help breakpoint   -> for breakpoint subcommand's help
(lldb) breakpoint list    -> list all the breakpoints.
(lldb) breakpoint delete  -> Delete the specified breakpoint(s).  If no breakpoints are
               specified, delete them all.
(lldb) breakpoint delete 7.1   -> delete breakpoint 7.1

and, you can use this command to continue the program:
(lldb) c

Upvotes: 26

GameLoading
GameLoading

Reputation: 6708

Press Command + alt + B to see all breakpoints.

Select the breakpoint that you want to remove and press delete.

Upvotes: 4

mfaani
mfaani

Reputation: 36427

Not knowing what exactly Swift error breakpoint is...I had enabled it by doing such:

enter image description here

Guess what happens?!

It will act like a breakpoint on errors thrown by your own code, i.e. wherever you use a throw statement.

For more see here and here

Upvotes: 0

Vladimir Vodolazkiy
Vladimir Vodolazkiy

Reputation: 564

I found one additional case when such breakpoint is activated:

If you set breakpoint on the code, which is actually is not compiled for selected target this part of code is not highlighted or marked, and breakpoint is set actually elsewhere in this file where debugger consider is as close as it can.

So you need to be sure that code, where breakpoint is set is compiled :-)

Upvotes: 0

Totty.js
Totty.js

Reputation: 15841

Open the Breakpoints view: alt+shift+5 and then right click in the empty space and hit "delete all". It will actually remove the not existent breakpoints.

Upvotes: 0

Kelvin
Kelvin

Reputation: 1192

I have the same problem before, I think its an Xcode bug. You may check if there any unwanted breakpoints created by Xcode in Breakpoint Navigator (cmd 6), delete them and it should be fine.

Upvotes: 2

Akku
Akku

Reputation: 4454

user278859's answer is basically really a true answer, as this seems to be a bug in Xcode 4. I just had the same problem. I set a breakpoint at one place in a UIWebView delegate's shoudlStartLoadWithRequest-method (no other active breakpoints in the project) and the debugger stops in another method (in this case repeatedly webViewDidFinishLoad:) of the same object.

So I'd say this is an Xcode bug. Found no way of fixing this btw., other than removing the above breakpoint ... Screenshot:

enter image description here

Upvotes: 4

Snowcrash
Snowcrash

Reputation: 86317

Xcode 4 introduced an Exception breakpoint which seems to be on by default. i.e. when there's an exception it breaks.

This will catch an exception even if you haven't clicked the Breakpoints button.

You can check via the Debug Navigator whether it's been triggered - you'll see an "objc_exception_throw".

Upvotes: 0

user278859
user278859

Reputation: 10519

Ok, I deleted the only breakpoint in the offending class which was no where near the line where the debugger was breaking and the problem went away.

Fasttracks, thanks for the suggestion. I am using xCode 4 and command+alt+b no longer works. There is now a Breakpoint Navigator where all the brekpoints are listed. There was no breakpoint in the list that corresponded to the line where the break was happening.

Upvotes: 3

Related Questions