microsoft / microsoft/vscode-python-debugger

Feature Request: Conditional Breakpoints

Open
#883 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage-needed
Dominant language
TypeScript
Stars
180
Forks
126
Avg merge
2d 3h
Merged PRs (30d)
3

Description

Motivation

For efficient debugging, I very often need to have a break-point trigger only under certain circumstances.

Consider the following setup

Image

here I may for example only wish for the break point to trigger if

"advanced" in case.tags

holds.

Current workaround

Currently, I can achieve this, but only by rewriting the code as a workaround:

Image

Proposal

The workaround is clearly clumsy, esp. as it means injecting code into ones codebase, which is en par with adding print statements everywhere.

What would be much more ideal would be one could simply add dynamic trigger-conditions to the break points.[^trigger]

For example in the UI would could add a right-click menu to the individual break points > add conditions > user entry of boolean expression:

Image

Here one could consider the cases

checkbox trigger condition behaviour
* never triggers
(empty) always triggers
cannot be evaluated never triggers
can be evaluated and evaluates to true triggers in the given instance
can be evaluated and evaluates to false does not trigger in the given instance

[^trigger]: currently they can only statically be toggled.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named in the issue. Begin by tracing how breakpoint state and evaluation are handled in the Python debugger; done should cover the listed UI and behavior cases for empty, invalid, true, and false conditions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, typescript, vscode
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.