In article <js************ **@phaedsys.dem on.co.uk>,
Chris Hills <ch***@phaedsys .demon.co.ukwro te:
>In article <ln************ @nuthaus.mib.or g>, Keith Thompson
<ks***@mib.org writes
>>Ravi <ra*********@gm ail.comwrites:
>>Can you all please suggest a program which tell us the range of memry
addresses occupied by the given c program?
>>It can't be done in portable standard C. Try asking in a newsgroup
that deals with your operating system.
>It has nothing to do with the OS it sounds like he is looking for the
map file that the compiler will output.
Chris, I was really convinced that you knew better than that.
The OP's question is completely meaningless on some operating systems,
and on some other operating systems none of the major compilers generate
memory maps (though other tools might be able to generate them.)
The question is also not specific enough to be answerable by the
"memory map" pancea. If for a particular program, some of the
variables are tossed into a section marked as Demand Zero Paging,
an other variables are tossed into a section for Block Initialize Data,
and some of the code is put down below the 64K boundary so short addresses
can be used, and if there are unusued gaps between each of these, then
does the OP need to know the start and end of each and every used segment?
If there happen to be 5 unused bytes between the code for one function
and the code for another, is that detail required to be revealed, since
those 5 bytes are -not- part of the range of memory addresses
occupied by that program? Does the OP need to know where each DLL
or DSO will get mapped into in virtual address space? If the OP is
using a malloc that uses mmap() to bring pages into the virtual address
range then the mmap() could "fill in" any space not nailed down, in
which case the "range of memory addressed occupied by the given c program"
could only be determined by -running- the program.
--
"No one has the right to destroy another person's belief by
demanding empirical evidence." -- Ann Landers