views:

445

answers:

4

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?

+4  A: 

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.

Gamecat
You mean like opening the disassembly of the process and inspecting raw addresses?
sharptooth
That is a possibility. Like I said, you need them rarely, but if you need them, you are glad they are available.
Gamecat
+4  A: 

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.

Canopus
+2  A: 

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.

Jason S
Is there anything on the UNIX platform similar to the list files? If yes, how do I generate it?
Shree
no idea. check your compiler documentation.
Jason S
A: 

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?

This should be a separate question. This site is not a forum. Someone asks a question, others answer it. Putting a question into a place intended for answers is a realy wrong idea.
sharptooth