trace_dispatch(frame, event, arg)
This function is installed as the trace function of debugged frames. Its return value is the new trace function (in most cases, that is, itself).
The default implementation decides how to dispatch a frame, depending on the type of event (passed as a string) that is about to be executed. event can be one of the following:
-
"line"
: A new line of code is going to be executed. -
"call"
: A function is about to be called, or another code block entered. -
"return"
: A function or other code block is about to return. -
"exception"
: An exception has occurred. -
"c_call"
: A C function is about to be called. -
"c_return"
: A C function has returned. -
"c_exception"
: A C function has raised an exception.
For the Python events, specialized functions (see below) are called. For the C events, no action is taken.
The arg parameter depends on the previous event.
See the documentation for sys.settrace()
for more information on the trace function. For more information on code and frame objects, refer to The standard type hierarchy.
Please login to continue.