What is the use of .map files VC++ linker produces when /MAP parameter or "Generate map file" project setting is used? When do I need them and how do I benefit from them?
You need them rarely, but they can be handy debugging some problems because they give information on the location of functions and data.
For example:
- detailed information on all segments (code, data and other).
- link line numbers to code
You can use map files for debugging tools.
A nice article on how to use map files for finding crashes.
http://www.codeproject.com/KB/debug/mapfile.aspx
Manually doing all this is very uninteresting.
I am not aware of any tools which can read map file and help in finding the crash location. If anybody knows please update us.
For embedded systems, map files are a lot more useful. (Although you wouldn't be using Visual C++ for that ;)
Things like knowing how close you are to running out of program/data memory, and what location a particular variable resides in, are important.
Does anyone know how to get the RAM/ROM occupancy (of the compiled set of files) in the -map file in Windows environment. I use KEIL-ARM compiler which generates a map file with several info, including the RAM/ROM occupancy of the code. However, in microsoft environment, when I use the /MAP or /MAPINFO linker switches, it does not generate this memory information in the map file. I would appreciate if anyone could let me know how to get this memory info in a map file using microsoft linker switches?