gh-120769: Add pdb meta command to print frame status.#120770
Merged
gaogaotiantian merged 3 commits intopython:mainfrom Jun 20, 2024
Merged
gh-120769: Add pdb meta command to print frame status.#120770gaogaotiantian merged 3 commits intopython:mainfrom
gaogaotiantian merged 3 commits intopython:mainfrom
Conversation
Member
Author
|
Hi @iritkatriel , sorry about the back and forth on this matter. I thought |
iritkatriel
approved these changes
Jun 20, 2024
Member
Author
|
Do you think it's worth it to backport this and fully remove the |
Member
|
Yes, might as well. |
gaogaotiantian
added a commit
to gaogaotiantian/cpython
that referenced
this pull request
Jun 23, 2024
This was referenced Jun 23, 2024
mrahtz
pushed a commit
to mrahtz/cpython
that referenced
this pull request
Jun 30, 2024
noahbkim
pushed a commit
to hudson-trading/cpython
that referenced
this pull request
Jul 11, 2024
estyxx
pushed a commit
to estyxx/cpython
that referenced
this pull request
Jul 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using
w 0is a neat trick but it messed up withcmd.Cmd. We lost the last command with executing a valid command.I came up with a way to sneak in secret commands (what I call a meta command) without changing too much of the current structure. The meta commands will not be recorded by
cmd.Cmdand we can do whatever we want with it.With this feature, we can unify the way to print the stack entry with or without the commands in
cmdqueue.I also renamed
preloop- that's only used for display and it is only supposed to be displayed when user input is expected ("stops in the current frame" according to the docs). The test coverage is not great but for now it will display while commands fromcmdqueueare executing.The reason I changed
displayin a seemingly unrelated fix is because this is the way to ensure display still shows after stack entry print, not before.By unifying the way to print frame status, we can print more stuff per stop, like async/thread info.
Meta commands could be useful in the future for us to sneak in other secret commands without messing with the core cmdloop and the command completion.
w 0on empty line when there are commands incmdqueue#120769