Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b9a9628

Browse files
committed
Admit that we'll never add the args for a "call" event to the profile
and trace functions; this now declares that None will be passed for the "call" event. This closes SF bug/suggestion #460315.
1 parent 02fac83 commit b9a9628

2 files changed

Lines changed: 9 additions & 11 deletions

File tree

Doc/lib/libpdb.tex

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -355,24 +355,25 @@ \section{How It Works \label{debugger-hooks}}
355355

356356
\item[\code{'call'}]
357357
A function is called (or some other code block entered). The global
358-
trace function is called; arg is the argument list to the function;
358+
trace function is called; \var{arg} is \code{None};
359359
the return value specifies the local trace function.
360360

361361
\item[\code{'line'}]
362362
The interpreter is about to execute a new line of code (sometimes
363363
multiple line events on one line exist). The local trace function is
364-
called; arg in None; the return value specifies the new local trace
365-
function.
364+
called; \var{arg} is \code{None}; the return value specifies the new
365+
local trace function.
366366

367367
\item[\code{'return'}]
368368
A function (or other code block) is about to return. The local trace
369-
function is called; arg is the value that will be returned. The trace
370-
function's return value is ignored.
369+
function is called; \var{arg} is the value that will be returned. The
370+
trace function's return value is ignored.
371371

372372
\item[\code{'exception'}]
373-
An exception has occurred. The local trace function is called; arg is
374-
a triple (exception, value, traceback); the return value specifies the
375-
new local trace function
373+
An exception has occurred. The local trace function is called;
374+
\var{arg} is a triple \code{(\var{exception}, \var{value},
375+
\var{traceback})}; the return value specifies the new local trace
376+
function.
376377

377378
\end{description}
378379

Python/ceval.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
/* Execute compiled code */
33

44
/* XXX TO DO:
5-
XXX how to pass arguments to profile and trace functions?
65
XXX speed up searching for keywords by using a dictionary
76
XXX document it!
87
*/
@@ -605,7 +604,6 @@ eval_frame(PyFrameObject *f)
605604
whenever an exception is detected. */
606605
if (call_trace(tstate->c_tracefunc, tstate->c_traceobj,
607606
f, PyTrace_CALL, Py_None)) {
608-
/* XXX Need way to compute arguments?? */
609607
/* Trace function raised an error */
610608
return NULL;
611609
}
@@ -616,7 +614,6 @@ eval_frame(PyFrameObject *f)
616614
if (call_trace(tstate->c_profilefunc,
617615
tstate->c_profileobj,
618616
f, PyTrace_CALL, Py_None)) {
619-
/* XXX Need way to compute arguments?? */
620617
/* Profile function raised an error */
621618
return NULL;
622619
}

0 commit comments

Comments
 (0)