VxWorks how to get address of local variable to see the memory contents.
A:
This is like any other C environment: address of (local or global) var
is &var
.
mouviciel
2009-02-03 12:35:44
+1
A:
It depends on the context. In a program, like mouviciel mentioned, simple use the address of operator (&).
If you are in a host or target shell, you can see global variables and static variables by simply entering the variable name.
-> var
var = 0x103b4188: value = 10 = 0xa
->
This gives you the address of the variable and the content. However, this would not work with a local (automatic) variable, as it is on the stack.
Benoit
2009-02-03 18:34:44
I didn't think of host or target shell. I consider your answer better than mine.
mouviciel
2009-02-03 20:06:39