Skip to content

Inline breakpoints should use the most recent pdb isntance, instead of creating a new one #121450

@gaogaotiantian

Description

@gaogaotiantian

Feature or enhancement

Proposal:

Currently, the inline breakpoints (breakpoint() or pdb.set_trace()) will create a new pdb instance, which breaks all the instance-specific feature for pdb. For example, all the displays will be discarded. The last_cmd will be lost so <Enter> will not repeat the last command you type. Breakpoints will be preserved but the corresponding commands won't exist anymore. Everything stored in the pdb instance will not work anymore.

We should make inline breakpoints work as the real breakpoints set in the debugger - just break there and keep everything. My approach is to store the last pdb instance created and use that in pdb.set_trace(). This solves all the issues above and I think it's the right way to go.

It will also make features the rely on data on instance possible with inline breakpoints.

Very few existing code will be impacted.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions