Wednesday 7 July, 2010

Map files

[Click on the title to follow the link to the article]

Map file: One of those files which we overlook and try to solve errors which can so easily be debugged and solved. The article says "Map files ... or Painless Proactive Problem Pinpointing" - I totally agree. It is not only useful for debugging but also for memory occupancy and size measurements of your code.

I had to make a study of % increase in memory occupancy because of using "some" code in an embedded target and Microsoft environment. For the embedded target, the KEIL-ARM compiler (this is what I use) has a very neat debug-info generator and map-file creator. The map file, thus created, has all sorts of info that an (embedded) software engineer is looking for. There is even split up of RAM/ROM occupancy sizes of each file. Awesome!

It is very different in the Microsoft environment. (I guess no one really bothers much about memory usage in the first place, then talk of RAM/ROM, etc, which are so critical on embedded target platforms). There are linker switches (http://msdn.microsoft.com/en-us/library/y0zzbyt4%28v=VS.80%29.aspx) to generate map file in the windows environment. However, this does not have image component size information.

Well, there are some tools that come along with VC++ (as pointed in the article) for this purpose. "dumpbin.exe" is one such tool. (There are so many tools in VC++ "tools" or "common" directory, which I have never even bothered to look so far. I am not sure if all of them are really useful). There are also tools with which one could get the symbol table information and so on. And, it is all there in your PC, you don't have to "Google" for a freeware that will help you find this. There are already several articles in the Internet to help you and just a click away.

Have fun!