I need to debug a complex GC written in C++ and there is a lot of aliasing for variables inside the code which makes tracking the value of a specific variable quite difficult. Usually I do this using data breakpoints, but obviously the address changes every debug session and I need to add a breakpoint where the variable is created, get its address, remove the old breakpoint, add the new one, etc. If I multiply this process for several variables it becomes annoying and also time consuming.
Is it possible to add a data breakpoint programmatically?
I've found this answer Programmatic data breakpoint in Visual Studio 2010, but it's quite old and I hope there is better support for this.