Search code examples
c++visual-studio-2010debuggingbreakpoints

Do data breakpoints affect the compiled code in visual studio?


I know that inserting a normal breakpoint can change the compiled code slightly, but is this also true for data breakpoints? I don't see how they could logically be put 'inline' with the code.


Solution

  • If you're referring to a "variable watch" or "memory break-point" where you're asking your debugger to break if a variable or region of memory changes, then that is accomplished by asking your CPU to monitor that memory address / range for all write access, and to break into the debugger to let it decide to break or not for each write. (I'm not privy to how the CPU/debugger exactly achieves this, just that it does).

    This doesn't modify either the contents of your memory, or your executable code in memory.