Is it possible to break execution when a watch variable (not a property, just a normal variable) changes to see where the change occurred? I searched and found this question which relates to properties it seems which is not what I’m looking for.
This variable is used several times in several thousand lines of code, but it is only changed from null when a problem happens. We are trying to track that problem down.
+in it to indicate that it is conditionalHowever: frankly, I find the following simpler and much more efficient – especially for fields; say we start with:
we change it just for now to:
and just put a break-point on the
setline. It should still compile, and you can see the change trivially. For more complex cases:and put the breakpoint on the inner-most line; this bypasses code that sets the field without actually changing the value.