Even if in your case the address of FInternalIndex was kept the same, that is not a given. Not even, if the executable is still identical (i.e. not modified).
Chances are that it may be the same, if there was no user input, no calls to random, no decencies on OS resource allocs that may have changed. (e.g. if the watchpoint was inside a block of memory that was returned by a call to WIN-API, and may have changed as Handles and GDI objects may be at different mem location (not sure if that can happen, but wouldn't be sure).
Also in case of threads, timings between threads may lead to different order of mem allocs.
As soon as at any one point the memory layout changes, then the instance may be at a different location.
In your app, the behaviour may be simple and predictable.
And maybe an option for such a case can be added. There are various todo for watchpoints...
However, if a watchpoint for a field is active at start of the app (and has the correct address), then it will
- trigger when the constructor runs, because it zeros the memory
- if any other code uses (and then frees) the memory before the instance is created. (because if it is the same memory, it does not matter if it belongs to that instance)
The more generic way would be to automatically recreate it.
But I don't think it currently would work, because it likely is not correctly reset when the app is started again.
If the watchpoint would be correctly reset, and disabled at launch of the app, then
- you could have a breakpoint at the location at which the var/field is first in scope (the point were you want to start watching)
- It would have the "break" action disabled, so your app would keep running (or stepping)
- it would enable the group in which the watchpoint is / and the watchpoint would initialize
- the breakpoint would disable itself, so it would not act again.
As I said, I don't think it currently will work that way.
(It might with gdb, (maybe needing "reset debugger", because then there is no old data....)