View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014187CMake(No Category)public2013-06-02 18:182013-11-04 09:33
ReporterYichao Yu 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformlinuxOSarch linuxOS Version
Product VersionCMake 2.8.11 
Target VersionCMake 2.8.12Fixed in VersionCMake 2.8.12 
Summary0014187: variable_watch with no command name will cause READ_ACCESS for all variables in the current scope.
DescriptionWhen a variable that is being watched by variable_watch with no command name is accessed, not only a message is printed out but all other variables in the current scope will feel an READ_ACCESS and therefore execute watch commands on them.
Steps To Reproducefunction(my_func)
  message("my_func")
endfunction()
variable_watch(a my_func)
set(a "")

variable_watch(b)
set(b "")

expected output:

my_func
* Variable "b" was accessed using REMOVED_ACCESS in: ....
  The value of the variable: ""
  The list file stack: ...

actual output:

my_func
* Variable "b" was accessed using REMOVED_ACCESS in: ....
  The value of the variable: ""
  The list file stack: ...
my_func
TagsNo tags attached.
Attached Files

 Relationships
related to 0014188closedBrad King variable_watch print REMOVED_ACCESS instead of MODIFIED_ACCESS when set the value of the variable. 

  Notes
(0033170)
Yichao Yu (reporter)
2013-06-02 18:22

... forgot to select, I can always reproduce this.
(0033210)
Brad King (manager)
2013-06-03 11:07

It looks like this was introduced when the feature was first added:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f9f1ccad#patch6 [^]

The logic at line 117:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmVariableWatchCommand.cxx;hb=v2.8.11#l117 [^]

prints out all definitions when no command processes the watch. It looks like leftover debugging code to me.
(0033216)
Brad King (manager)
2013-06-03 13:25

Fixed:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=515f9af0 [^]

While at it, I improved the access message format to include a better call stack:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=647745b3 [^]
(0034357)
Robert Maynard (manager)
2013-11-04 09:33

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-06-02 18:18 Yichao Yu New Issue
2013-06-02 18:22 Yichao Yu Note Added: 0033170
2013-06-03 11:07 Brad King Note Added: 0033210
2013-06-03 11:07 Brad King Status new => backlog
2013-06-03 13:06 Brad King Assigned To => Brad King
2013-06-03 13:06 Brad King Status backlog => assigned
2013-06-03 13:06 Brad King Target Version => CMake 2.8.12
2013-06-03 13:25 Brad King Note Added: 0033216
2013-06-03 13:25 Brad King Status assigned => resolved
2013-06-03 13:25 Brad King Resolution open => fixed
2013-06-03 13:25 Brad King Fixed in Version => CMake 2.8.12
2013-06-03 13:26 Brad King Relationship added related to 0014188
2013-11-04 09:33 Robert Maynard Note Added: 0034357
2013-11-04 09:33 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team