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.
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:
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.
When you're debugging, you want to make sure you're catching exceptions.
Go to the breakpoint navigator (⌘-7)
Click plus. You'll see this:
Select 'Add Exception Breakpoint'
With that enabled, your application will stop on exceptions and display the backtrace in the debug navigator (⌘-6).
Related
I have write some test code, just for testing the stack overflow.
int MyFunc(long c)
{
char buffer[12];
return sprintf(buffer, "xxxxxxxxxxx%ld", c);
}
when I compile it to ARM64 assembly, I got the result
MyFunc(long): // #MyFunc(long)
sub sp, sp, #32 // =32
stp x29, x30, [sp, #16] // 16-byte Folded Spill
add x29, sp, #16 // =16
adrp x1, .L.str
mov x2, x0
add x1, x1, :lo12:.L.str
add x0, sp, #4 // =4
bl sprintf
ldp x29, x30, [sp, #16] // 16-byte Folded Reload
add sp, sp, #32 // =32
ret
so, what does 16-byte Folded Spill mean? and why?
Stackoverflow.com is the perfect place for stack spill questions. =)
16-byte is because we are saving two 8-byte registers to the stack.
Folded for this one I am going to have to guess. Folding is when math operations are simplified combined. I going to go out on a whim and say it does not apply here and that it’s just a generic compiler message that only sometimes applies. If we had several of these in a row to save many registers to the stack and incremented the stack pointer(sp) just once then it would be combined because we would be using -32+16=-16 and this does not cause any extra math.
sub sp, sp, #32
stp x27, x28, [sp]
stp x29, x30, [sp, #16] <--- folded because we decrement sp once on 1st row
Spill is the process of saving registers to memory because we need the extra registers. This is often referred to as spilling the registers to memory.
I am very new to Swift so I apologise if my question may sound obvious, but I looked everywhere and could not find any solutions for my issue. I know there are other similar questions to mine, it is really not my intention to make a duplicate, but I believe I needed to make a new question because none of the answers to said similar questions have solved my problem, it appears to me to be a different kind of issue and I would love to receive some help.
I have been trying to develop this app which has been running just fine in the simulator in the past few weeks. However, I need to try it out on my iOS device to try some features that involve the use of a camera. The problem is that the app crashes on launch every single time. I tried to download another app from GitHub, a simple one that doesn't involve the use of pods, and it runs fine on the same iOS device. It's just my app that doesn't. Here's the error on crash:
dyld`__abort_with_payload:
0x102dab5dc <+0>: mov x16, #0x209
0x102dab5e0 <+4>: svc #0x80
-> 0x102dab5e4 <+8>: b.lo 0x102dab600 ; <+36>
0x102dab5e8 <+12>: stp x29, x30, [sp, #-0x10]!
0x102dab5ec <+16>: mov x29, sp
0x102dab5f0 <+20>: bl 0x102da9be8 ; cerror_nocancel
0x102dab5f4 <+24>: mov sp, x29
0x102dab5f8 <+28>: ldp x29, x30, [sp], #0x10
0x102dab5fc <+32>: ret
0x102dab600 <+36>: ret
dyld`_dyld_start:
0x102d61000 <+0>: mov x28, sp
0x102d61004 <+4>: and sp, x28, #0xfffffffffffffff0
0x102d61008 <+8>: mov x0, #0x0
0x102d6100c <+12>: mov x1, #0x0
0x102d61010 <+16>: stp x1, x0, [sp, #-0x10]!
0x102d61014 <+20>: mov x29, sp
0x102d61018 <+24>: sub sp, sp, #0x10 ; =0x10
0x102d6101c <+28>: ldr x0, [x28]
0x102d61020 <+32>: ldr x1, [x28, #0x8]
0x102d61024 <+36>: add x2, x28, #0x10 ; =0x10
0x102d61028 <+40>: adrp x3, -1
0x102d6102c <+44>: add x3, x3, #0x0 ; =0x0
0x102d61030 <+48>: mov x4, sp
0x102d61034 <+52>: bl 0x102d6107c ; dyldbootstrap::start(dyld3::MachOLoaded const*, int, char const**, dyld3::MachOLoaded const*, unsigned long*)
-> 0x102d61038 <+56>: mov x16, x0
0x102d6103c <+60>: ldr x1, [sp]
0x102d61040 <+64>: cmp x1, #0x0 ; =0x0
0x102d61044 <+68>: b.ne 0x102d61050 ; <+80>
0x102d61048 <+72>: add sp, x28, #0x8 ; =0x8
0x102d6104c <+76>: br x16
0x102d61050 <+80>: mov x30, x1
0x102d61054 <+84>: ldr x0, [x28, #0x8]
0x102d61058 <+88>: add x1, x28, #0x10 ; =0x10
0x102d6105c <+92>: add x2, x1, x0, lsl #3
0x102d61060 <+96>: add x2, x2, #0x8 ; =0x8
0x102d61064 <+100>: mov x3, x2
0x102d61068 <+104>: ldr x4, [x3]
0x102d6106c <+108>: add x3, x3, #0x8 ; =0x8
0x102d61070 <+112>: cmp x4, #0x0 ; =0x0
0x102d61074 <+116>: b.ne 0x102d61068 ; <+104>
0x102d61078 <+120>: br x16
Here's a picture of the error.
I have been searching all over the internet for this question and I've tried all the possible solutions, but with no success. Again, perhaps it's because of my lack of experience... but here's what I have tried so far:
I added the frameworks in the tab target > general, with no success.
Here's a picture.
I changed the frameworks' status to "Optional" in the tab build phases > link binary with libraries.
Here's a picture of that, too.
If I change it to "embed & sign", it gives me multiple errors like these, one for each framework:
Both red,
and yellow errors.
If I go to run > diagnostics, guard malloc & thread sanitizer are already unticked:
Here's my stats.
At one point, I was desperate enough to try and delete all the frameworks files lol (I obviously did so in a duplicate project) and it was disastrous.
The trust settings of my certificates in the keychain are all set to System Defaults.
My info.plist does have "Privary - Camera Usage Description", type String.
If it makes any difference, I use pods for Firebase and IQKeyboardManagerSwift. I say this because I noticed how most of the custom frameworks have the name of the pods (don't laugh at me please, I literally started coding like last month lol!). However one thing that isn't really clear to me is why these frameworks are greyed out in the Navigator, maybe that could be the problem? Again, I have no idea... plus, I have some frameworks in the pods section (see below), and at least a hundred in the app section, below the "info.plist" file and the "GoogleService-Info.plist" file. Is that even normal?
Frameworks in the app section;
Frameworks in the pods section.
I think I said a lot but if any information is missing please let me know. I want to thank everybody in advance for any help you may be able to provide, I am so desperate to solve this!
PS: I am not even allowed to enter images yet, I hope you can check the links, though!
I totally forgot to update this, but I solved by updating my phone to 13.4 (which is still a beta version) and my xcode too (also beta version). It seems that the problem is the previous/current update, not sure why but it solved the problem for me. Hope it can save someone else some headache.
I am facing an issue . Few weeks back I updated my iPhone to iOS 12.1 . I have an iOS app where it can synchronize with dropbox or Evernote.
After updating to iOS 12.1, app freezes when it try to synchronize with dropbox/Evernote. Below is error snippet :
libsystem_kernel.dylib`kevent_id:
0x211b1c95c <+0>: mov x16, #0x177
0x211b1c960 <+4>: svc #0x80
-> 0x211b1c964 <+8>: b.lo 0x211b1c97c ; <+32>
0x211b1c968 <+12>: stp x29, x30, [sp, #-0x10]!
0x211b1c96c <+16>: mov x29, sp
0x211b1c970 <+20>: bl 0x211b10800 ; cerror_nocancel
0x211b1c974 <+24>: mov sp, x29
0x211b1c978 <+28>: ldp x29, x30, [sp], #0x10
0x211b1c97c <+32>: ret
I have looked up all over the internet but didn't found the solution. Below are the links :
[https://github.com/EddyVerbruggen/SocialSharing-PhoneGap-Plugin/issues/681]
[https://forums.developer.apple.com/thread/62335]
[https://github.com/flutter/flutter/issues/17936]
Any kind of help is appreciated.
Thank you.
P.S. App works fine on <12.
I create a game with Unity for iOS.
When Xcode upgrades to 9.3 , sometimes the project crashes with this error when I'm in the game:
was compiled with optimization - stepping may behave oddly; variables
may not be available.
I searched and find many ways to fix this problem, but i still get it.
I didn't use optimization and i uncheck the code strip in unity setting.
any idea how can i fix it?!
UPDATE:
Another informat
ShouldUpdateTransformBefore():
0x100f9c064 <+0>: ldr x8, [x0]
0x100f9c068 <+4>: ldr x9, [x1]
0x100f9c06c <+8>: cmp x8, x9
0x100f9c070 <+12>: b.eq 0x100f9c07c ; <+24> at RectTransform.cpp:319
0x100f9c074 <+16>: cset w0, lo
0x100f9c078 <+20>: ret
0x100f9c07c <+24>: ldr w9, [x1, #0x8]
0x100f9c080 <+28>: cmn w9, #0x1 ; =0x1
0x100f9c084 <+32>: b.eq 0x100f9c0a4 ; <+64> at RectTransform.cpp:320
0x100f9c088 <+36>: ldr w10, [x0, #0x8]
0x100f9c08c <+40>: cmp w9, w10
0x100f9c090 <+44>: b.eq 0x100f9c0ac ; <+72> at RectTransform.cpp:327
-> 0x100f9c094 <+48>: ldr x11, [x8, #0x10]
0x100f9c098 <+52>: ldr w9, [x11, w9, sxtw #2]
0x100f9c09c <+56>: cmn w9, #0x1 ; =0x1
0x100f9c0a0 <+60>: b.ne 0x100f9c08c ; <+40> at RectTransform.cpp:322
0x100f9c0a4 <+64>: mov w0, #0x0
0x100f9c0a8 <+68>: ret
0x100f9c0ac <+72>: orr w0, wzr, #0x1
0x100f9c0b0 <+76>: ret
Although seems it is too late, I just face similar problem and share the solution here.
Reason
In my case, the application using too much memories causes the testing device crashes. You can test it with a better device. My application crashes in iPhone7 but not in iPhone7 Plus. And you can also check it in the Memory column in the left.
Solution
If application crashes when loading scene, here is the solution, or suggestion.
Assume there are 2 scenes, A and B. Both of them cost 1GB memory.
When A -> B, A will be destroyed after B is loaded, which means 2GB is requested when A + B. It is too heavy for mobile.
So I add scene C, a middleware cost 0.1GB memory.
And now I go to scene B through A -> C -> B.
A + C request 1.1GB, then Scene A releases.
After that, C -> B request 1.1GB.
The maximum memory of loading scene from A to B decrease from 2GB to 1.1GB. It solved my application crashing problem. Hope it helps.
I have read the other questions which are related to the same problem, but I am not getting the right answer... It just keeps getting me crazy.
I am developing an iOS app and it runs nice on the simulator provided by the Xcode IDE, but when I install it on my iPhone and run it, a white screen appears and the debugger stops the execution, showing me this error, with the signal SIGABRT:
dyld`__abort_with_payload:
0x1000f5cd0 <+0>: movz x16, #0x209
0x1000f5cd4 <+4>: svc #0x80
-> 0x1000f5cd8 <+8>: b.lo 0x1000f5cf0 ; <+32>
0x1000f5cdc <+12>: stp x29, x30, [sp, #-16]!
0x1000f5ce0 <+16>: mov x29, sp
0x1000f5ce4 <+20>: bl 0x1000f5500 ; cerror_nocancel
0x1000f5ce8 <+24>: mov sp, x29
0x1000f5cec <+28>: ldp x29, x30, [sp], #16
0x1000f5cf0 <+32>: ret
The app does not request anything (access to something, network calls, etc...), it just draws some custom views without any special feature.
What's the meaning of that? I have run other apps of my own on my iPhone and all of them worked nice.
How can I solve this problem?
One possibility is that your project like to library that only provide x86 binary?