Is it possible to see the output of Objective-C ARC?

In xcode, it is possible to get some Objective-C code to see the code that will be output to Assembly.
Is it possible to see this code with ARC support to see Objective-C that will be issued by ARC?

+4
source share
2 answers

This is not possible because ARC does not generate Objective-C code. ARC is a compiler function that modifies an assembly created in the same way as an optimization feature. You cannot tell the compiler to show you "optimized" C code; optimization is not applied at the C code level. Similarly, you cannot ask to see the "ARC-ified" Objective-C, since ARC memory management calls are not applied at the Objective-C code level.

If you really want to see where the memory management calls are made, you will have to look at the assembly.

+5
source

ARC is not such an Objective-C output, it is a compiler phase that changes the assembler / machine code that the compiler produces, and as you noticed, you can see this in Xcode. However, if you use the decompiler in binary format, you should see an “MRC equivalent” that is just as good as you. Try Hopper - the demo is available, I have not used it myself, I don’t know the manufacturers, etc. However, it creates a psuedo-code that looks like a structured assembly, not Objective-C. NTN.

+5
source

Source: https://habr.com/ru/post/1489372/


All Articles