Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gaogaotiantian opened this issue Jul 6, 2024 · 0 comments
Labels
type-feature A feature request or enhancement

Comments

@gaogaotiantian
Copy link
Member

gaogaotiantian commented Jul 6, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant