Set a Line Breakpoint
To set a line breakpoint:
1
Click on the Line Number
To set a line breakpoint, click on the line number in the glyph margin of the editor.
If it is a valid location for a breakpoint (i.e. there is machine code associated with the line of source code) then a red, square icon will replace the line number and the entire line of code will be highlighted with the same color as the square.
If it is a valid location for a breakpoint (i.e. there is machine code associated with the line of source code) then a red, square icon will replace the line number and the entire line of code will be highlighted with the same color as the square.
Troubleshooting
Sometimes you may not be able to set a breakpoint on a particular line. When this is the case, no breakpoint will appear, or it may appear with the broken breakpoint icon . There are a number of potential causes for this situation, including:- Compiler optimization is enabled above 0, which may result in code being rearranged, procedurally abstracted, or in some cases optimized out of existence. If there is no machine code below the C code, there is no place to set a breakpoint.
- Some elements of C don't directly translate to machine code where they occur in the source code as can sometimes occur with an opening brace '{', compiler directives, and sometimes even looping keywords like while.
If you encounter this problem, in some cases it may help to insert a Nop(); (no operation) macro where you want a breakpoint, since this directly translates to a nop instruction in the machine code which is a perfectly valid place to set a breakpoint.