Debugger is setting breakpoints at random locations
I'm having the same problem. It cropped up after I removed some conditional compile sections.
I tried performing a clean project and recompile. It didn't help. My optimization is set to none. When I step with the debugger it lands on lines that don't have code and skips over lines of code. Somehow the mapping between the source code and what it's executing is broken, The problem I'm trying to solve depends on being able to tell if a particular conditional statement is being executed, so this makes it really difficult to figure out what's going on.
Update: It turns out that I had a mashup of two different build configurations from some previous experiments with different build variants, and I still had an older build variant whose compiled binary was actually getting loaded even though the debugger was showing my latest code. I had deleted the older build variant folder from my project workspace but it that variant still existed in the project preferences, and apparently the files are still there on the file system.
I got clued in when I was making changes to the source code and the behavior was the same.
Deleting my unused build variants fixed the problem.