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



On Sun, 31 Dec 2006 01:37:33 +0100, in comp.lang.c , jacob navia
<jacob@xxxxxxxxxxxxxxxx> wrote:

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?


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

No, he wants to use some free tools. You imply by the above that no
free software can be sophisticated, which is untrue as I'm sure you
know. There's even a compiler which is reputed to be fairly
sophisticated which is free.

This depends on your OS.

Agreed. The OP wold be better advised to ask in a group specialising
in his OS, as such tools will be highly OS-dependent.

can give you more info, but they are not really reliable. The man
page of top says for instance

(man pages are notorious for getting out of date mind you)

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.

FWIW there /are/ various free profiling and analysis tools for
Windows, eg at winternals.com

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

procexp.exe



--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
.