Why does watch window display variables in a such way?

Jie Zhang zhangjie@magima.com.cn
Tue Apr 15 10:20:00 GMT 2003


Hi,

I build insight-5.3 on a RedHat 8.0 box. I find a rather strange 
phenomenon of watch window when I use it to debug a rather simple 
program. I put some variables in the watch window. When I restart the 
program, the values of variables displayed in the watch window remain 
the old value of last debug session and does not change according to the 
real value. But print command displays the real value.

I try to find the reason. So I build the snapshot 
insight+dejagnu-20030415 on the same box. Since the watch window is 
rewritten in this snapshot from insight-5.3, we can find why the values 
remain the old value. The variables put into the watch window in last 
debug session become gray, which means they are not in scope. It seems 
that variables in watch window have a scope property, which enables 
displaying multiple variables with same name but different scopes. Since 
the the watch window in the snapshot allows variables with same names, I 
put the variables into the watch window again and they show the real values.

But in insight-5.3, the variables don't become gray and cannot give us a 
hint that they are out of scope. This is rather misleading. I think the 
watch window of insight-5.3(.x) should not behave in a such way unless 
the rewrite of watch window by Martin M. Hunt is merged into the 5.3 branch.


- Jie




More information about the Insight mailing list