What does MapFileParser do?

I updated to Unity 5.1.3 today and noticed that generated Xcode projects now get a binary named MapFileParser exported alongside the .xcodeproj file. The only information I could find about this tool is what it prints out on the command line:

Usage: MapFileParser -format=<MSVC|Clang|SNC> mapFile outputFile

Out of general curiosity: what does this program do, and why is it included with a generated Xcode project? Does Unity run it when re-exporting (through the “Append” option)? I’m guessing it might have something to do with IL2CPP.

We have some custom tools around maintaining and modifying our Unity-generated Xcode projects for smoother integration with Cocoapods and our build pipeline. Is there anything new we should know about the Unity->iOS build process regarding this tool?

Would be great if someone from the Unity team could provide some insight. Thanks!

The MapFileParser is a utility that parser the linker map file for a few different compilers and generates a binary output file with the information that the IL2CPP runtime needs to generate correct managed stack traces.

The utility is not strictly necessary, as your project will run without it (although with possibly incorrect stack traces). It doesn’t require too much time during the build process to run, so it is probably worth keeping around.

It is part of the generated Xcode project because it must run after the linker completes. You should see it run as part of a post build script in the Xcode project. In some build workflows, the Xcode project is not built on the same machine as the Unity installation, so we need to copy this utility into the Xcode project.