diff options
author | Guido van Rossum <guido@python.org> | 2003-04-09 19:06:21 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2003-04-09 19:06:21 (GMT) |
commit | a12fe4e81fa3221458e16225e76ec7b8a05820ee (patch) | |
tree | 05f9ba6e5dab68aa1627e340aa1b6f2437c8e302 /Python/ceval.c | |
parent | 12dd7b12c6bce882a7e789173760abab62c80304 (diff) | |
download | cpython-a12fe4e81fa3221458e16225e76ec7b8a05820ee.zip cpython-a12fe4e81fa3221458e16225e76ec7b8a05820ee.tar.gz cpython-a12fe4e81fa3221458e16225e76ec7b8a05820ee.tar.bz2 |
- New function sys.call_tracing() allows pdb to debug code
recursively.
- pdb has a new command, "debug", which lets you step through
arbitrary code from the debugger's (pdb) prompt.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index f965d38..080b3c1 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3024,6 +3024,24 @@ call_trace(Py_tracefunc func, PyObject *obj, PyFrameObject *frame, return result; } +PyObject * +_PyEval_CallTracing(PyObject *func, PyObject *args) +{ + PyFrameObject *frame = PyEval_GetFrame(); + PyThreadState *tstate = frame->f_tstate; + int save_tracing = tstate->tracing; + int save_use_tracing = tstate->use_tracing; + PyObject *result; + + tstate->tracing = 0; + tstate->use_tracing = ((tstate->c_tracefunc != NULL) + || (tstate->c_profilefunc != NULL)); + result = PyObject_Call(func, args, NULL); + tstate->tracing = save_tracing; + tstate->use_tracing = save_use_tracing; + return result; +} + static int maybe_call_line_trace(Py_tracefunc func, PyObject *obj, PyFrameObject *frame, int *instr_lb, int *instr_ub) |