Skip to content

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

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

Closed
gaogaotiantian opened this issue Jun 16, 2024 · 1 comment
Closed
Labels
type-feature A feature request or enhancement

Comments

@gaogaotiantian
Copy link
Member

gaogaotiantian commented Jun 16, 2024

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

@gaogaotiantian gaogaotiantian added the type-feature A feature request or enhancement label Jun 16, 2024
@gaogaotiantian
Copy link
Member Author

This is done in #120770.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant