Skip to content

What to do with Misc/gdbinit? #102809

Description

@sobolevn

Quoting: #101866 (comment)

Does this file have any tests? I suspect that most of the code in this file is wrong (as we have changed much of CPython since it was written).

Problems:

  1. After gh-101865: Deprecate co_lnotab from code objects as per PEP 626 #101866 gdbinit will use a deprecated co_lnotab property
  2. There are no tests for it as far as I know
  3. When the internal of CPython are changed, there's no way to detect that it was broken
  4. There's no owner of this file, who can validate changes and keep it up-to-date

What should we do with it?

Linked PRs

Activity

  1. terryjreedy commented on Mar 18, 2023

    @terryjreedy
    Member

    @sobolevn Discussing what to do with Misc/gdbinit could have been a 'discuss' thread, but perhaps you hope to followup with PR. I have some concrete ideas based on its current content.

    @warsaw You contributed this file in 2001.
    @gpshead I believe you are the only other active coredev who made substantial contributions to this file.
    In 2020, you added

    # NOTE: If you have gdb 7 or later, it supports debugging of Python directly
     # with embedded macros that you may find superior to what is in here.
     # See Tools/gdb/libpython.py and http://bugs.python.org/issue8032.
    

    If now, 13 years later, everyone uses a version of gdb that obsoletes this file, then we might delete it. End of issue.

    If not, I think it should be moved to Tools/gdb, along side its current only content, libpython.py. (Can this be done without losing blame history? Which I obviously used.) This should make it more discoverable.

    The NOTE: (above) should by expanded to say that some things might not work and that PR fixes would be welcome (if true ;-). I think a last revision date should be added here or maybe to individual macros (see below).

    The macro that uses co_lnotab should get a note with its expected drop dead version.

    @smontanaro In 2010 you added define pystack with this note.

    # Note: The name of the main interpreter function and the function which
    # follow it has changed over time.  This version of pystack works with this
    # version of Python.  If you try using it with older or newer versions of
    # the interpreter you may will have to change the functions you compare with
    # $pc.
    

    this version of Python should have been spelled out (2.7? 3.0?). Does the macro need an update now?

  2. smontanaro commented on Mar 18, 2023

    @smontanaro
    Contributor

    @terryjreedy I no longer use it, but can retrieve it from wherever if I change my mind. GDB's better Python support works for me.

  3. warsaw commented on Mar 19, 2023

    @warsaw
    Member

    Unless @gpshead or perhaps @vstinner (or @davidmalcolm) have any objections, let's delete it.

  4. self-assigned this
    on Mar 20, 2023
  5. sobolevn commented on Mar 20, 2023

    @sobolevn
    MemberAuthor

    As far as I know, Victor is not active right now. I will wait for @gpshead's feedback before sending a PR :)

  6. davidmalcolm commented on Mar 20, 2023

    @davidmalcolm
    Member

    Unless @gpshead or perhaps @vstinner (or @davidmalcolm) have any objections, let's delete it.

    FWIW I have no objections to removing gdbinit, but I haven't done CPython work in a decade, so my opinion here is probably irrelevant.

  7. gpshead commented on Mar 20, 2023

    @gpshead
    Member

    I'll approve any PR removing it.

  8. added a commit that references this issue on Mar 20, 2023
  9. added a commit that references this issue on Mar 20, 2023
  10. gpshead commented on Mar 20, 2023

    @gpshead
    Member

    removed!

  11. added a commit that references this issue on Mar 27, 2023
  12. added 3 commits that reference this issue on Apr 5, 2023
  13. added a commit that references this issue on Apr 8, 2023
  14. added 2 commits that reference this issue on Apr 11, 2023
  15. added a commit that references this issue on Jan 19, 2026
  16. added 2 commits that reference this issue on Jan 19, 2026
  17. added 2 commits that reference this issue on Jan 19, 2026
  18. added a commit that references this issue on Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

type-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions