- Qt Creator Documentation
- Add breakpoints
- Qt Creator 18.0.2

Create state charts ◦ Attach the debugger to running applications

# Add breakpoints

To add breakpoints:

1. Add a new breakpoint in one of the following ways:
   - In the code editor, click the left margin or select F9 (F8 on macOS) on a particular line where you want the application to stop.
   - In the Breakpoint Preset view or the Breakpoints view:
     - Double-click the empty part of the view.

     - Right-click the view, and select Add Breakpoint in the context menu.
2. In Breakpoint type, select the location in the application code where you want the application to stop.

Clear Enabled to make the breakpoint temporarily inoperative as if you had deleted it, but keep the information about the breakpoint, so that you can enable it again later.

The other options to specify depend on the location you select, such as file name and line number, address, expression, or function name. The following table summarizes the advanced options.

Option | Value
--- | ---
Condition | The condition to evaluate before stopping at the breakpoint if the condition evaluates as `true`.
Ignore count | The number of times to ignore the breakpoint before the application stops.
Thread specification |

Path

Determines how to specify the path when setting breakpoints:

- Use Engine Default is the preferred setting of the debugger engine.
- Use Full Path passes the full path to avoid ambiguity if several modules contain files with the same name. This is the engine default for CDB and LLDB.
- Use File Name passes the file name only. This is useful when the location of the source tree does not match the one used when building the modules. This is the engine default for GDB as using full paths can be slow with it.

Module | Specify the module (base name of the library or executable) for function or file type breakpoints to speed up debugger startup (CDB, LLDB).
Commands | Commands to execute when the application stops. List one command per line. GDB executes the commands in the order in which you specify them.
Tracepoint only | A tracepoint lets you log information about the application without adding log statements or otherwise modifying your code. You can set conditions for the tracepoint.
Message | The tracepoint message to show in Application Output.

See also How To: Debug, Debugging, Debuggers, Debugger, and Setting breakpoints.