开发者

xcode settings -- path to link map file -- what is it?

Can anyone explain what this setting means, and what it does?

EDIT: Thank you for the answers. Got it about the crash reports. Let me ask th开发者_开发百科is -- does the link map file have any impact on my app's execution?


A link map file is a text file that details where data, code, etc lives inside your executable. Very handy for stack traces when your program crashes, and for examining memory.

Just ask Xcode to make one, and then open it in textedit or whatever. You'll see all your method names and variable names, alongside addresses.

If you submit your app to the app store, it's vital you keep your map file, so if Apple manage to crash your app, you'll stand a better chance of making head or tail of the crash report.


Only relevant if you're generating link maps. If you look at the bottom of the settings window when you select Path to Link Map File it says:

This setting defines the path to the map file written by the linker when the Write Link Map File setting is activated. By default a separate file will be written for each architecture and build variant, and these will be generated in the Intermediates directory for the target whose produce is being linked. [LD_MAP_FILE_PATH, -map]

For Write Link Map File it says:

Activating this setting will cause the linker to write a map file to disk which details all symbols and their addresses in the output image. The path to the map file is defined by the Path to Link Map File setting. [LD_GENERATE_MAP_FILE, -map]

It's fairly unusual to have any need to look at link maps, unless you're working on embedded systems.


The default is...

$(TARGET_TEMP_DIR)/$(PRODUCT_NAME)-LinkMap-$(CURRENT_VARIANT)-$(CURRENT_ARCH).txt.

So for a target, named AtoZ...

.../DerivedData/AtoZ/Intermediates/AtoZ.build/Debug/AtoZ.build/AtoZ-LinkMap-normal-x86_64.txt

Sample output of such a file can be found here.


In your target build settings make sure Write Link Map File is set to YES

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜