Skip to content

pdb: Pass debug commands directly via set_trace() instead of rcLines.extend() #133926

Closed
@Chang-LeHung

Description

@Chang-LeHung

Feature or enhancement

Proposal:

Currently, when attaching a remote PDB session in _connect(), debug commands are passed indirectly by extending the rcLines list before calling set_trace():

remote_pdb.rcLines.extend(commands.splitlines())  # Indirect
remote_pdb.set_trace(frame=frame)

https://github.com/python/cpython/blob/main/Lib/pdb.py#L3386C1-L3387C42

we can use the following statement:

remote_pdb.set_trace(frame=frame, commands=commands.splitlines())

This change preserves the existing functionality, while improving interface consistency with pdb.

Linked PRs

Activity

added a commit that references this issue on May 12, 2025

gh-133926: pass commands via remote_pdb.set_trace instead of using re…

ae74e3f
gaogaotiantian

gaogaotiantian commented on May 12, 2025

@gaogaotiantian
Member

Thank you for noticing this.

Chang-LeHung

Chang-LeHung commented on May 12, 2025

@Chang-LeHung
ContributorAuthor

My pleasure. By the way, I love your videos on Bilibili.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pdb: Pass debug commands directly via set_trace() instead of rcLines.extend() · Issue #133926 · python/cpython

      Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

      Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant