python / python/cpython

Allow switching to pretty-printer when using `gdb`

Open
#129,351 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triaged type-feature
Dominant language
Python
Stars
77.2k
Forks
36k
PR merge metrics
PR metrics pending

Description

Can we remove If True: from gdb bindings?

I think it was created for future features, but it was 15 years ago.

Found 2 locations (not testcase for interpreter):

https://github.com/python/cpython/blob/7ec17429d462aee071c067e3b84c8a7e4fcf7263/Tools/gdb/libpython.py#L1587

https://github.com/python/cpython/blob/7ec17429d462aee071c067e3b84c8a7e4fcf7263/Tools/gdb/libpython.py#L1602

Additional information

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Reporter: Burkov Egor (eburkov@rvision.ru).

Organization: R-Vision (support@rvision.ru).

Linked PRs
  • gh-138169

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in Tools/gdb/libpython.py at the two locations linked in the issue and inspect the surrounding gdb bindings. Confirm how the existing If True guards affect pretty-printer switching; done means the obsolete guards are removed at both locations and the gdb behavior is verified, while checking linked PR gh-138169 first.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.