cold4bet
cold4bet

Reputation: 3

IOS Debugging Memory Reference in Xcode

I am new to xcode and I am trying to figure out how debug. My question is my debugger keeps going to this screen.(I cant send images yet)

UIKit`-[UIControl sendAction:to:forEvent:]:

0x18a7762f4 <+0>:  stp    x22, x21, [sp, #-48]!
0x18a7762f8 <+4>:  stp    x20, x19, [sp, #16]
0x18a7762fc <+8>:  stp    x29, x30, [sp, #32]
0x18a776300 <+12>: add    x29, sp, #32
0x18a776304 <+16>: mov    x19, x4
0x18a776308 <+20>: mov    x20, x2
0x18a77630c <+24>: mov    x21, x0
0x18a776310 <+28>: mov    x0, x3
0x18a776314 <+32>: bl     0x1926cb424
0x18a776318 <+36>: mov    x22, x0
0x18a77631c <+40>: adrp   x8, 94917
0x18a776320 <+44>: add    x8, x8, #4072
0x18a776324 <+48>: ldr    x0, [x8]
0x18a776328 <+52>: adrp   x8, 91481
0x18a77632c <+56>: ldr    x1, [x8, #3376]
0x18a776330 <+60>: mov    x2, x20
0x18a776334 <+64>: mov    x3, x22
0x18a776338 <+68>: mov    x4, x21
0x18a77633c <+72>: mov    x5, x19
0x18a776340 <+76>: bl     0x1926cb298
0x18a776344 <+80>: mov    x0, x22
0x18a776348 <+84>: ldp    x29, x30, [sp, #32]
0x18a77634c <+88>: ldp    x20, x19, [sp, #16]
0x18a776350 <+92>: ldp    x22, x21, [sp], #48

->

I know these are memory references but what use does it serve? Is there some way being on this screen can be useful or should I skip over this.

Thanks for helping newbie.

Upvotes: 0

Views: 545

Answers (2)

Caleb
Caleb

Reputation: 125007

You're looking at assembly code because the debugger stopped in some function or method for which it doesn't have source code. The best thing to do in this situation is to look at the stack trace and choose the top-most stack frame that's in your code. That will show you the last instruction in your code that caused the problem.

The stack trace is shown in the debug navigator on the left here:

Xcode

You can see that the first stack frame is selected here, because I hit a breakpoint in my code (which you can see on the right side) and the debugger stopped on that line. In your case, you might have hit an exception or other error that caused the debugger to stop in code that's not yours, so you'll need to look for the first stack frame in the list that's shown in black rather than gray. Click on that and you'll see where your code was when the error happened.

Upvotes: 2

user1078170
user1078170

Reputation:

When you're debugging, you want to make sure you're catching exceptions.

  1. Go to the breakpoint navigator (⌘-7)
  2. Click plus. You'll see this: enter image description here

  3. Select 'Add Exception Breakpoint'

With that enabled, your application will stop on exceptions and display the backtrace in the debug navigator (⌘-6).

Upvotes: 0

Related Questions