mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile (#4056)
This commit is contained in:
parent
018e1b7aad
commit
131fd7f96c
3 changed files with 40 additions and 22 deletions
|
@ -1300,7 +1300,6 @@ Python-level trace functions in previous versions.
|
|||
| :const:`PyTrace_C_RETURN` | Function object being called. |
|
||||
+------------------------------+--------------------------------------+
|
||||
|
||||
|
||||
.. c:var:: int PyTrace_CALL
|
||||
|
||||
The value of the *what* parameter to a :c:type:`Py_tracefunc` function when a new
|
||||
|
@ -1357,16 +1356,18 @@ Python-level trace functions in previous versions.
|
|||
function as its first parameter, and may be any Python object, or *NULL*. If
|
||||
the profile function needs to maintain state, using a different value for *obj*
|
||||
for each thread provides a convenient and thread-safe place to store it. The
|
||||
profile function is called for all monitored events except the line-number
|
||||
events.
|
||||
profile function is called for all monitored events except :const:`PyTrace_LINE`
|
||||
and :const:`PyTrace_EXCEPTION`.
|
||||
|
||||
|
||||
.. c:function:: void PyEval_SetTrace(Py_tracefunc func, PyObject *obj)
|
||||
|
||||
Set the tracing function to *func*. This is similar to
|
||||
:c:func:`PyEval_SetProfile`, except the tracing function does receive line-number
|
||||
events.
|
||||
|
||||
events and does not receive any event related to C function objects being called. Any
|
||||
trace function registered using :c:func:`PyEval_SetTrace` will not receive
|
||||
:const:`PyTrace_C_CALL`, :const:`PyTrace_C_EXCEPTION` or :const:`PyTrace_C_RETURN`
|
||||
as a value for the *what* parameter.
|
||||
|
||||
.. _advanced-debugging:
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue