Assume I have a class definition like this:

```
class A {
private:
    Field f;
public:
   /*A hundred methods all of which modify f*/

    m1();
    m2();
    ...
    m100();
}

```

We know before hand that all of these methods, if called, will modify f.

Assume you have a very spaghetti code base.

You need to find at runtime if and where f is actually modified. 

You could use gdb, set a break point at every single method and see where execution stops and then unwind the stack to see which method called any of the m\*() methods. This is very slow, prone to human error and not necessarily possible in a code base using emscripten, or where python calls the C++ binary after setting some state...

You could comment out all such methods and explore all places in the code where the compiler complains. This is, imho much worse than the prior, and it does do it at runtime, so it's harder to determine which method will ACTUALLY be called.

Similar as the above, you could mark all the above methods as deprecated, but it has more or less the same problems.

Does anyone have a suggestion on determining when and where the field actually gets modified?