tags:

views:

226

answers:

2

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
+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
I didn't think of host or target shell. I consider your answer better than mine.
mouviciel