4 ms·
This 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
by jparishy 12y ago
This 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)