-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
"smart command mode" for ipdb (like pdb++). #9449
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
Conversation
If e.g. "c" is a variable currently visible, then "c" should print it instead of running the "continue" Pdb command. This idea was first implemented by pdb++. It is possible to force the standard pdb behavior (bypass variable checking) by prefixing the command with "!!", e.g. "!!c" to continue.
| # with the same name exists. | ||
| cmd, arg, newline = super(Pdb, self).parseline(line) | ||
| if cmd in self.curframe.f_globals or cmd in self.curframe.f_locals: | ||
| return super(Pdb, self).parseline("!" + line) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So !... means to execute the line (after !) as regular Python code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is normal pdb behavior: link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for confirming :-)
|
This looks reasonable to me. Pinging @gotcha for the external ipdb package - any thoughts on this? |
|
This seems to be causing a build hang on Python 2.7 on Travis, though. I restarted it, but the same happened again. Can you investigate? |
|
I didn't have any hangs, but did find another bug ( |
|
Those unrelated failures look like you may have a leftover test file from an older version of IPython. |
|
I'm surprised that making a new style class like that works: I would expect that the base class it inherits from would have to be new style as well for super() to work. Have you tested this manually in Python 2? |
|
I did, and you can see the tests passing too. I guess |
|
Thanks. I'll give @gotcha a chance to have a look, but I think this is looking OK. |
|
|
|
No, I don't think it should. But I thought you might want to have a look at it, since you probably use the debugger a fair bit :-) |
This is a manual revert of PR ipython#9449 Closes ipythongh-10037 I don't think there's currently enough support for smart command mode to be worth adding a config option for it now. We can always add this later.
If e.g. "c" is a variable currently visible, then "c" should print it
instead of running the "continue" Pdb command. This idea was first
implemented by pdb++.
It is possible to force the standard pdb behavior (bypass variable
checking) by prefixing the command with "!!", e.g. "!!c" to continue.