7 ms·
iOS 8 Debugging Case Study
- johnames57 12y agoFantastic case study!
- jparishy 12y agoThis is a really great read, especially for new iOS developers who haven't picked up a ton of debugging tricks from experience alone. In particular the section "Calling Conventions 101" contains a lot of very useful information that isn't documented very well in any of the iOS resources provided by Apple (AFAIK). Commit it all to memory, you'll be glad you did :)
- micampe 12y agoThe calling conventions are described here https://developer.apple.com/library/ios/technotes/tn2239/ https://developer.apple.com/library/ios/technotes/tn2239/ with links to more in depth descriptions and other useful informations. This article has some more good tips on extracting information from those registers. http://www.sealiesoftware.com/blog/archive/2008/09/22/objc_explain_So_you_crashed_in_objc_msgSend.html http://www.sealiesoftware.com/blog/archive/2008/09/22/objc_e...
- mikeash 12y agoApple uses the standard calling conventions for the CPU architectures they use, so there's no real need nor expectation for Apple to document those aspects beyond saying "we use the standard conventions," which they do say if you go digging. In some instances they also replicate the documentation for the conventions.
- jparishy 12y agoWell, for new developers they might not put together "we use this calling convention" with "and that means you can find things like self, _cmd, or the exception that was thrown in these registers ... which can ease debugging your app". That's useful information I wish they'd put up in their docs, is all.
- stephencanon 12y agoIt's not obvious that you can meaningfully talk about to "the standard conventions" on i386, x86_64, or armv7, as there are at least two widely-used conventions for each. arm64 comes the closest to having a single "standard", but Apple uses a (documented) tweaked version.
- masklinn 12y ago> It's not obvious that you can meaningfully talk about to "the standard conventions" on i386, x86_64, or armv7, as there are at least two widely-used conventions for each. x86_64 has the System V AMD64 ABI calling conventions which are as standard as can be and used by almost everybody. Microsoft being their usual assholes does not mean their ABI is anything other than their ABI.
- nezza-_- 12y agoMicrosoft being their usual assholes does not mean their ABI is anything other than their ABI Not helpful.
- hornetblack 12y agoPlan 9, and therefore The Go Programming language use a different one, which is the same across all architectures supported by Plan9's assembler. (It's one reason why cgo call's are not cheap)
- davidbanham 12y agoDoes anyone else feel like maybe the entire iOS development experience is batshit insane?
- tl 12y agoI wouldn't say the entire experience is insane, but a lot of things feel unnecessarily difficult (hello crash symbolication, auto-layout debugging, etc...) compared to their web development counterparts. On the other hand, you do get greater performance and stability (but not perfect stability, after all it wouldn't be an iOS release if Apple didn't break something and completely ignore radars).
- coldcode 12y agoNot really, I work on iOS code much more complex and rarely have to stoop to so many tricks. Due to having to support iOS 6 I still have to use XCode 5 so some of this isn't even available to me. After a while you figure out the problems just from the symptoms. My current project was written by Elbonians who were paid a pittance so there is lots of fun debugging. That said figuring out bugs in iOS is a major league PITA. I have one now in NSURLSession which is batshit insane.
- mikeash 12y agoThere's a lot of extremely frustrating and stupid aspects to it... but none of those are in any way related to anything discussed in the article, so I find your comment a bit odd. What makes iOS development so frustrating to me is the constant struggle with code signing, device provisioning, Xcode crashes, random failures to install or run programs, and all the craziness around App Store review.
- faizmokhtar 12y agoI agree. I just started to learn iOS development at my current job (around 4 months), and configuring with code signing & XCode configuration is a pain in the ass.
- ktran03 12y ago