Skip to content

pdb/bdb changes for PEP 669 #103103

Closed
Closed
@gaogaotiantian

Description

@gaogaotiantian

Feature or enhancement

Adapt pdb/bdb to PEP669

Pitch

After #103082, we will have the chance to build a much faster debugger. For breakpoints, we do not need to trigger trace function all the time and checking for the line number. Other optimizations for commands like return are available too.

The bad news is - it's almost impossible to do a completely backward compatible transition because the mechanism is quite different.

There are a couple of ways forward:

  1. Create a new basic debugger based on the new mechanism. Leave bdb as it is and redesign pdb to use the new base debugger. Encourage users to migrate to the new base debugger while keep supporting bdb.
  • pro: no historical burden, clean usage
  • con: new module, potential duplicate code
  1. Work on top of the current bdb, provide two ways to trigger the debugger. User can choose whether to use the old set_trace or the new mechanism.
  • pro: incremental change, no new modules, reuse of the existing code
  • con: the code could be messy, there will be two sets of APIs living in the same class with potential conflict
  1. Just change bdb starting 3.12 to use the new mechanism and let users worry about their own tools built upon it.
  • pro: code reuse still exists, life is much easier, enjoy the speed up immediately
  • con: may not be an option
  1. Leave everything there to use the old way.
  • pro: no work need to be done at all
  • con: no benefit from PEP 669 at all
  1. Some other great idea that I did not think of

Previous discussion

https://peps.python.org/pep-0669/

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtype-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions