Share via


How Can I Fix “Breakpoint Has Moved” Errors?

Full Problem Description: I set a breakpoint at a line in my source code, but I’m actively editing the code as I debug. When I rebuild the project, I get an error message telling me that the breakpoint has moved. How can I stop this from happening?

Breakpoints set on source-code lines stay on the same line number. If you edit the code, changing the number of lines, the breakpoint may no longer be on a line with a valid statement.

Breakpoints set at the beginning of the function remain with the function, regardless of what source-code line the function begins on. If possible, set the breakpoint at the beginning of the function by specifying the function name, instead of setting the breakpoint on a line number.

For more information, see .