Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode not stopping on breakpoint

I have some weird problem with Xcode since I upgraded my Xcode to 5 from 4.6. When I set the breakpoint in a file, the program actually stops at the breakpoint, but I can't see my code in the workspace. It loads some other system codes like

 0x2ff8:  calll  0x2ffd  -[ViewController viewDidLoad] + 13 at ViewController.m:28
0x2ffd:  popl   %eax
0x2ffe:  movl   12(%ebp), %ecx
0x3001:  movl   8(%ebp), %edx
0x3004:  movl   %edx, -12(%ebp)
0x3007:  movl   %ecx, -16(%ebp)
0x300a:  movl   18799(%eax), %ecx
0x3010:  movl   18559(%eax), %edx

enter image description here

When I click the continue button it shows my code again. I have tried,

  • Creating a new project
  • Relaunching Xcode
  • Restarting the system
  • Re-installing Xcode

None of these helped me. I have seen a lot of questions in StackOverflow which discuss "Breakpoints not working...", but for me the breakpoints are working, just not stopping in the correct position.

like image 344
Ramaraj T Avatar asked Sep 17 '13 11:09

Ramaraj T


People also ask

How do I Turn Off breakpoints in Xcode?

Xcode displays a breakpoint icon to indicate the location. Drag a breakpoint up or down to move it to another location; drag it away from the gutter to remove it. Click the breakpoint icon in the debug area toolbar to activate or deactivate all breakpoints.

How to debug with user-defined breakpoints in Xcode?

One of the few things you might do for every new Xcode project you create is adding those handy breakpoints that helped you debug a lot of bugs. This is a redundant process and can be solved with user-defined breakpoints in Xcode. Once you moved a breakpoint it will be shown in its own section containing all user-defined breakpoints.

How do I pause a line in Xcode?

Navigate to a line in your code where you want execution to pause, then click the gutter or line number in the source editor to set a breakpoint. Xcode displays a breakpoint icon to indicate the location. Drag a breakpoint up or down to move it to another location; drag it away from the gutter to remove it.

Why doesn't the debugger stop on breakpoints when I debug?

This article helps you resolve a problem where the debugger doesn't stop on breakpoints when you debug ASP.NET applications in Microsoft Visual Studio .NET. When you debug ASP.NET applications in Visual Studio .NET, the debugger might not stop on breakpoints. This problem occurs because ASP.NET debugging isn't enabled on the application.


2 Answers

I found the problem, Somehow the "Show Disassembly when debugging" was enabled in my Xcode which creates that problem. When I disabled it, all my debugger stopped in my source code.

You can find it under Product->Debug Workflow->Show Disassembly when debugging

Edit

In the latest Xcode it is under Debug->Debug Workflow->Show Disassembly when debugging

like image 141
Ramaraj T Avatar answered Oct 18 '22 23:10

Ramaraj T


Xcode 6:

Go to Build Settings and make sure your "Strip style" is set up as "Non-Global Symbols" and not as "All Symbols"

enter image description here

like image 4
Kappe Avatar answered Oct 19 '22 01:10

Kappe