Skip to content

Unify the way for pdb to print the stack entry before user input #120603

Closed
@gaogaotiantian

Description

@gaogaotiantian

Feature or enhancement

Proposal:

Currently pdb does something like this:

if self.cmdqueue:
    self.cmdqueue.append('w 0')
else:
    self.print_stack_entry(self.stack[self.curindex])

The output is identical in most cases, but there are edges. For example, when display command is involved (which prints stuff in preloop hook). Another inconsistency is about lastcmd - when the user hits enter without any command, the default it to repeat the last command - w 0 could be repeated.

We should make it more consistent so there's only one entry here. It will also lay the foundation in the future where extra information is needed to be printed (e.g. thread/async task info). We don't need to duplicate code in multiple places.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

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