Typically, you set and clear breakpoints before you start a process. To set a source-level breakpoint, select a line number in the Source view.
Source View Line Number Indicators
• A bold line number denotes that the compiler generated one or more line number symbols for the source line. Multiple symbols might be within a single image file, for example on a "for" loop statement. Or, the line number symbols might be spread across multiple image files if the source file was compiled into the executable, shared libraries, and/or CUDA code.
• No bold indicates that the compiler did not generate any line number symbols for the source line. However, you can still set a sliding or pending breakpoint at the line, which is useful if you know that code for that line will be dynamically loaded at runtime, for example, in a dynamically loaded shared library or a CUDA kernel launch.
For example, Figure 42 illustrates that source lines 48 and 49 both have line number symbols. Lines with no bold indicate that no executable code exists at those source lines yet (although you can set a sliding or pending breakpoint at those lines, discussed in "Pending Breakpoints" and "Sliding Breakpoints").
Figure 42 – Possible breakpoint locations in the Source view
Set a breakpoint either by:
• Clicking directly on the line number in the Source view, or
• Right-clicking on the line number and using the context menu, or
• Clicking on a line in the Source View and then selecting the Action Points > Set Breakpoint menu item.
Once set, the breakpoint displays in the Action Points menu.
Figure 43 – Set a breakpoint
Add any number of breakpoints before you run your program. (You can add or remove breakpoints at any point during your program's execution.)
NOTE >> Setting a breakpoint on a line may cause that breakpoint to appear at many code locations. For example, setting a breakpoint on a line of templated code may cause the breakpoint to appear at all instances of that template.
When you set a breakpoint or barrier point, it is defined by a breakpoint expression, also called a breakpoint specification, displayed in the Action Points tab for that breakpoint, or entered into the CLI (if created using the CLI). For more information, see dbreak .