sudi wrote:
If I have a linker map file, is it possible to find sizeof( a structure )
or sizeof( a class) by just looking at the MAP file ? (I don't want to run
the program).
Everything that happens after the compilation stage is beyond the scope
of this newsgroup. How linkers should behave and the files they generate
are not defined in the C++ standard. So your question is off-topic in
this newsgroup, and is probably best asked in a newsgroup dedicated to
your development environment.
That being said; whether you can extract the information you want from a
map file depends on the linker you use. But it very unlikely you can
extract the size of a structure or a class itself from a map file. The
map file only tells you what is being put in the executable and the
location of an object inside the executable. Since class definitions are
typically not stored in the executable the map file won't provide any
information about these. Also you won't find local and dynamically
created instances of classes in the map file. However you may be able to
extract the size of global or static instances of a class or structure,
just look for the variable name in the map file.
Probably the easiest way to get the sizeof() information is just to
write a little test program.
--
Peter van Merkerk
peter.van.merkerk(at)dse.nl