Re: Good ways to analyze a running c-program?



dspfun a écrit :
I would like to analyze my running c-program.

What I would like to know for example is the range of the entire
address space of my running c-program (memory reserved for/by the
running program), starting address and sizes of text (code), stack,
heap, bss, constant data, linked in libraries, etc.

What are some good ways to extract this kind of information?

What (free) tools are the most common ones for displaying this kind of
information?

The main reason for this analysis is that I want to understand exactly
how my c-source code transforms to a running program and what memory
regions the program uses and for what the memory regions are used. An
example could be for example that I wanted to display all the constant
data (variables declared with the const modifier) of the running
program, is that possible?

BR!


So, you want to invest zero in software and get highly sophisticated
results...

This depends on your OS. If you run under linux you can try
the GNU profiler but last time I looked at it I do not remember
that it gave this kind of information. Other tools like "top",
can give you more info, but they are not really reliable. The man
page of top says for instance
TSIZE
The code size of the task. This gives strange values
for kernel processes and is broken for ELF processes.

Since all processes are ELF processes... this will not go very far.
But maybe this has improved in later versions, I really do not know.

Another possibility is tha you call yourself routines that give
this kind of info in your program and you call them at some
specific time, etc.

Under windows you can have several tools for doing that, but the only
really free one is the task manager, that will display the
memory/handles/paged/non paged memory/memory usage delta/
page faults/ and many other information.

Better tools are Intel's profiler, that is an excellent one
and will give you more detailed info. It costs around 500 US$.

If (under windows) you use the lcc-win32 debugger it will show you the stack
size of each thread but not when the process is running...


MMM... you give an idea. An oscilloscope-like display of memory usage
would be nice actually.


.



Relevant Pages

  • Turning Windows into a personal developer OS environment
    ... This thesis is on a new simplified concept on Windows ... OS Display Management, based on my 1980's generic ideas ... about early Windows programming methodologies: ... memory will be plenty and not to worry about. ...
    (microsoft.public.vstudio.development)
  • Displaying pixels (OS framework)
    ... This thesis is on a new simplified concept on Windows ... OS Display Management, based on my 1980's generic ideas ... about early Windows programming methodologies: ... memory will be plenty and not to worry about. ...
    (microsoft.public.windowsxp.general)
  • TP 6.0 Request.: SVGA BGI / Unit + Graphics conversion + Memory usage
    ... => a way to display any modern type graphics files ... Mostly memory trouble. ... my problem is I do not know how to display the ... but on most websites the extended memeory info is based on DOS ...
    (comp.lang.pascal.borland)
  • Re: Text overlay on image then Save to JPEG with reasonable DPI for Online printshop
    ... > Let's suppose I have an image of 1500 X 1500 pixels of which I ... picture at the top right of the card, or whether it is actually the card ... memory (an invisible VB picture box or a memory bitmap or DIBSection or ... What you "display to the user" while he is ...
    (comp.lang.basic.visual.misc)
  • Re: Support of a large table
    ... >> display different parts within different controls of a vb app. ... >> One part of the XML file identifies information about processor cylces. ... >> demanding on memory. ... > Try to open it in vb with DOM first. ...
    (comp.lang.basic.visual.misc)