Skip to content
IT glossary
ProgrammingUpdated December 3, 2026

Breakpoint

Точка останова

A breakpoint tells a debugger to pause a running program at a chosen spot or event so you can inspect values and see how execution got there.

What a breakpoint does

When a program returns the wrong result, the line that reports it often isn't the line that caused it. A breakpoint lets you pause earlier and check what the program actually knows at that moment. In most IDEs, you set a line breakpoint by clicking next to a line number. Run the program with the debugger attached, and when execution reaches that spot, it normally pauses before running the statement on that line. Pausing does not end the program.

What to do while execution is paused

Start with the local variables, then check the call stack if you need to know which function called the current one. Selecting a different stack frame lets you look at the variables available in that call. To move on, use Step Over to run the current line without following its function calls, or Step Into to follow a call into the function body. Continue resumes normal execution until another stop or until the program exits.

A regular line breakpoint can stop on every pass through a loop. A conditional breakpoint stops only when an expression you specify evaluates to true. Some debuggers also let you pause when an exception is thrown, even if the program catches it later.

Example: stop on the record that matters

Suppose an order report shows fewer items than expected:

const quantities = [2, 4, -1, 3];
let total = 0;
for (const quantity of quantities) {
  total += quantity;
}

Set a breakpoint on total += quantity with the condition quantity < 0. The debugger skips the first two iterations and stops with quantity equal to -1 and total still equal to 6. Step over the addition and total becomes 5. The arithmetic works as written; if negative quantities aren't valid, the next question is how one got into the input.

When breakpoints help—and when they don't

Breakpoints work well for following a failing test or checking why a request handler took an unexpected branch. If a breakpoint never hits, check that the input reaches that branch, that you're debugging the right process, and that the running build matches the source you're viewing. A comment or blank line has nothing to execute, so the debugger may reject the breakpoint or move it to an executable line.

Pausing can also change the behavior you're trying to observe. It can cause a request to time out or alter thread scheduling enough to hide a race condition. Logs or traces are often a better starting point for timing-sensitive bugs.

In an interview

In a debugging exercise, pick a breakpoint that tests a specific hypothesis. Say what value you expect to see before the line runs and what you would investigate if the value differs. That shows more than knowing which button to click.