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

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