Good ways to analyze a running c-program?



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!

.



Relevant Pages

  • Re: reading process memory
    ... I'm going to anticipate your next question, and say that if you're not the parent, you will have to "attach" to the process. ... There is one exception to this: you can setup a pipe or memory share between two processes, however, both processes have to agree to share some memory or connect via a pipe. ... Thank you for brief and altogether extensive explanation of the case.The thing i wanted to do is to read let's say portions of memory where .bss and .data block of a running program reside. ...
    (freebsd-questions)
  • Re: Accessing shared library problem
    ... a running program. ... they stick around in memory in the hope that they'll be ... Removing the file decrements ... In order to understand recursion you must first understand recursion. ...
    (comp.unix.aix)
  • Re: Process killed
    ... investigations with the running program to a more exact reason. ... Although it is probably safe to assume your process ran out of memory. ... going to be small, consisting of k permutations, it's better to have ... have the opportunity to at least increase swap space when I upgrade to ...
    (comp.os.linux.misc)
  • Is my memory is not enough?
    ... I declare as follows but when running program, ... there is a fatal error appear: ... I think I am using the same volume of memory for both version. ... I need to use 2D array. ...
    (comp.lang.c)