Главная страница | назад

Article #16318: Watch says local variables are 'out of scope'

 Question and Answer Database

FAQ1318C.txt   Watch says local variables are 'out of scope' 
Category   :Debugging
Platform    :All
Product    :BC++  5.x


Trying to watch local variables with the debugger, but it
says that they are "out of scope". I can see globals fine.
What's up?


The compiler is optimizing your code and placing the variables
on registers. You can use the CPU Window to check for their 
values, but you won't know which register carries which 
variable data.

Another way to go is to disable all optimizations. 
Go to Project | Options | Optimizations and check the box
that disable all of them.

If this fails, and you are using BC++ 5.x, you can declare
the variable 'volatile' which prevents it from being stored in
registers only.

7/2/98 10:32:32 AM

Last Modified: 01-SEP-99