diff options
author | Tian Gao <gaogaotiantian@hotmail.com> | 2024-09-25 18:18:01 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-25 18:18:01 (GMT) |
commit | 28efeefab7d577ea4fb6e3f6e82f903f2aee271d (patch) | |
tree | b053d588877512cbab2eb4782fa941cc33661cea /Doc/library/pdb.rst | |
parent | da5855e99a8c2d6ef2bb20124d2ebb862dbb971f (diff) | |
download | cpython-28efeefab7d577ea4fb6e3f6e82f903f2aee271d.zip cpython-28efeefab7d577ea4fb6e3f6e82f903f2aee271d.tar.gz cpython-28efeefab7d577ea4fb6e3f6e82f903f2aee271d.tar.bz2 |
gh-123756: Disable restart command if pdb is in inline mode (#123757)
Diffstat (limited to 'Doc/library/pdb.rst')
-rw-r--r-- | Doc/library/pdb.rst | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Doc/library/pdb.rst b/Doc/library/pdb.rst index ce7516a..1682eb0 100644 --- a/Doc/library/pdb.rst +++ b/Doc/library/pdb.rst @@ -198,7 +198,7 @@ The ``run*`` functions and :func:`set_trace` are aliases for instantiating the access further features, you have to do this yourself: .. class:: Pdb(completekey='tab', stdin=None, stdout=None, skip=None, \ - nosigint=False, readrc=True) + nosigint=False, readrc=True, mode=None) :class:`Pdb` is the debugger class. @@ -217,6 +217,13 @@ access further features, you have to do this yourself: The *readrc* argument defaults to true and controls whether Pdb will load .pdbrc files from the filesystem. + The *mode* argument specifies how the debugger was invoked. + It impacts the workings of some debugger commands. + Valid values are ``'inline'`` (used by the breakpoint() builtin), + ``'cli'`` (used by the command line invocation) + or ``None`` (for backwards compatible behaviour, as before the *mode* + argument was added). + Example call to enable tracing with *skip*:: import pdb; pdb.Pdb(skip=['django.*']).set_trace() @@ -233,6 +240,9 @@ access further features, you have to do this yourself: .. versionchanged:: 3.6 The *readrc* argument. + .. versionadded:: 3.14 + Added the *mode* argument. + .. method:: run(statement, globals=None, locals=None) runeval(expression, globals=None, locals=None) runcall(function, *args, **kwds) @@ -675,6 +685,10 @@ can be overridden by the local file. History, breakpoints, actions and debugger options are preserved. :pdbcmd:`restart` is an alias for :pdbcmd:`run`. + .. versionchanged:: 3.14 + :pdbcmd:`run` and :pdbcmd:`restart` commands are disabled when the + debugger is invoked in ``'inline'`` mode. + .. pdbcommand:: q(uit) Quit from the debugger. The program being executed is aborted. |