Skip to content
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

What to do with Misc/gdbinit? #102809

Closed
sobolevn opened this issue Mar 18, 2023 · 7 comments
Closed

What to do with Misc/gdbinit? #102809

sobolevn opened this issue Mar 18, 2023 · 7 comments
Assignees
Labels
type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Mar 18, 2023

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

@terryjreedy
Copy link
Member

terryjreedy commented Mar 18, 2023

@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?

@smontanaro
Copy link
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.

@warsaw
Copy link
Member

warsaw commented Mar 19, 2023

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

@sobolevn sobolevn self-assigned this Mar 20, 2023
@sobolevn
Copy link
Member Author

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

@davidmalcolm
Copy link
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.

@gpshead
Copy link
Member

gpshead commented Mar 20, 2023

I'll approve any PR removing it.

sobolevn added a commit to sobolevn/cpython that referenced this issue Mar 20, 2023
gpshead pushed a commit that referenced this issue Mar 20, 2023
Looks like the consensus is that we don't need this file anymore.
Old version can be always found here: https://github.com/python/cpython/blob/094cf392f49d3c16fe798863717f6c8e0f3734bb/Misc/gdbinit
@gpshead
Copy link
Member

gpshead commented Mar 20, 2023

removed!

@gpshead gpshead closed this as completed Mar 20, 2023
Fidget-Spinner pushed a commit to Fidget-Spinner/cpython that referenced this issue Mar 27, 2023
Looks like the consensus is that we don't need this file anymore.
Old version can be always found here: https://github.com/python/cpython/blob/094cf392f49d3c16fe798863717f6c8e0f3734bb/Misc/gdbinit
hrnciar added a commit to hrnciar/cpython that referenced this issue Apr 5, 2023
hrnciar added a commit to hrnciar/cpython that referenced this issue Apr 5, 2023
hrnciar added a commit to hrnciar/cpython that referenced this issue Apr 5, 2023
warsaw pushed a commit to warsaw/cpython that referenced this issue Apr 11, 2023
Looks like the consensus is that we don't need this file anymore.
Old version can be always found here: https://github.com/python/cpython/blob/094cf392f49d3c16fe798863717f6c8e0f3734bb/Misc/gdbinit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

6 participants