trace of memory access

G

Gregor Rot

i would like a trace of a program in the sense of all the memory
addresses it is accessing...so for example each time a statement like
(variable=10) is executed, i would like the address of the variable...

is this possible in some way or can somebody just give me a point where
to start searching (some documentation, etc?)

Tnx,
Gregor
 
C

Christopher Benson-Manica

Gregor Rot said:
i would like a trace of a program in the sense of all the memory
addresses it is accessing...so for example each time a statement like
(variable=10) is executed, i would like the address of the variable...
is this possible in some way or can somebody just give me a point where
to start searching (some documentation, etc?)

Your post is off-topic for comp.lang.c. Please visit

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

for posting guidelines and frequently asked questions. Thank you.
 
C

CBFalconer

Gregor said:
i would like a trace of a program in the sense of all the memory
addresses it is accessing...so for example each time a statement
like (variable=10) is executed, i would like the address of the
variable...

is this possible in some way or can somebody just give me a point
where to start searching (some documentation, etc?)

Trace it in machine code.
 
J

James McIninch

<posted & mailed>

Obviously C doesn't have anything to do with this, but the functionality you
seek is often provided by what is called a "debugger" -- an application to
aid in the debugging of compiled code. Chances are that if there's a C
compiler for the platform you are using, there's likely to be a debugger
too. Check forums that generally address issues related to your
compiler/platform for information about debuggers.
 
D

Dan Pop

In said:
Trace it in machine code.

If you can do that and you compile it with debugger information, you can
also have it traced at the C source code level.

BTW, was your answer supposed to be helpful?

Dan
 
D

Dan Pop

In said:
i would like a trace of a program in the sense of all the memory
addresses it is accessing...so for example each time a statement like
(variable=10) is executed, i would like the address of the variable...

is this possible in some way or can somebody just give me a point where
to start searching (some documentation, etc?)

Read your symbolic debugger's documentation. If it can't do it, your
only chance is to write a better one...

Dan
 
C

CBFalconer

Dan said:
If you can do that and you compile it with debugger information,
you can also have it traced at the C source code level.

BTW, was your answer supposed to be helpful?

Yes. The C source level debugger will usually show object values,
not their addresses. The machine code system will often show the
instruction operands, i.e. the addresses. They also often show
effective addresses, after evaluating indirection, indexing, etc.

This is all OT anyhow.
 
D

Dan Pop

In said:
Yes. The C source level debugger will usually show object values,
not their addresses.

Which is what you normally need. However, if you need the address of
a variable, the debugger will show it to you.
The machine code system will often show the
instruction operands, i.e. the addresses. They also often show
effective addresses, after evaluating indirection, indexing, etc.

If you have written your code in C, object names are usually much more
relevant than their addresses. You want to know when object X is
accessed, not when the address at which X is located is accessed, even
if the two things are equivalent.

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,817
Members
47,362
Latest member
ChandaWagn

Latest Threads

Top