"Praveen Potineni" <[EMAIL PROTECTED]> wrote in message
news:63391@palm-dev-forum...
>
> Hi All,
>
> I have a question that i'm not able to figure out..
> When i'm debuging on Emulator... I am able to see the variable and its
value
> in the  variable window of code warrior 7 debugger, even before the
debugger
> reaches the piece of code where i decleare the variables.
>
> How is it possible. I'm not able to understand this.
> I thought only after the variables are declared ..i'llbe able to see
> variables in the window. Debugger entered the function and this
happened.
>
> Any idea as to why it is hapenning like this

The compiler is emitting debugging information when it builds your code
into a Palm application.  However, the debug info isn't an exact match
to your code.  One of the ways it varies is how it handles variable
scoping.  The compiler emits info as is your variable always exists
within the function.  The value may not be reliable until you execute
the code to initialize the value -- basically, the variable list that
the debugger sees is the union of all variables defined in the function,
not dependent on when the variable is "defined" by the language.

Since code can't change that value, except by accidental stack smash,
until the variable is defined, don't worry about it.  If you're
concerned about seeing its value change, that isn't a problem, as the
space used for it is probably being reused by another variable that
doesn't have a lifetime that conflicts with it.





-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to