Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 880
user278859 Avatar asked Mar 15 '11 08:03

user278859


People also ask

Why breakpoint is not working in Xcode?

See this post: Breakpoints 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!

Why are my breakpoints not working?

If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.

What is exception breakpoint in Xcode?

An exception breakpoint is a type of breakpoint that is created when some exception occurs in the code. On occurrence of such exception our application stops at that given condition causing the exception and we can access all variables in scope at that breakpoint.


2 Answers

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 breanpoint 7.1

and, you can use this command to continue the program:
(lldb) c
like image 90
fluke Avatar answered Oct 30 '22 11:10

fluke


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

like image 43
Akku Avatar answered Oct 30 '22 13:10

Akku