Open gaogaotiantian opened 2 weeks ago
Rather than allow_restart, I'd add an enum for the ways that pdb can be invoked. That could be useful for other things.
Do you mean an indicator for whether pdb
is invoked through a inline breakpoint or command line?
Do you mean an indicator for whether
pdb
is invoked through a inline breakpoint or command line?
Yes
In that case, do you think we should have an unknown
option as the default - just to keep all the old behavior? Or we should be a bit more aggressive, and use inline
(or some other word) as default, to keep the default behavior safer for users? In another word, only allow commands like restart
when the pdb is invoked with an explicit option.
Besides restart
, I'll also work on exit
later. Currently when the user exits pdb invoked by an inline breakpoint an error will be raised and it's just weird to show a trackback of an exception when I exit the debugger. I'll make the behavior similar to other debuggers - ask the user whether they want to exit the process, and do a os._exit()
to kill everything quietly.
It can be None by default, and for each situation make None behave like it used to.
Feature or enhancement
Proposal:
Now when we have a
breakpoint()
in the source code and enter pdb, we can dorestart
and raise aRestart
exception - which in most cases will just stop the program with an exception. For other rare cases, it might be even worse.It simply does not make sense to allow a
restart
command if pdb is not brought up from command line - that exception is only caught in command line usage. So, we should only allowrestart
in command line usage and do nothing (except for an error) in other cases.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
Linked PRs