diff Python/ceval.c @ 28556:78395e5b4782 legacy-trunk

- 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.
author Guido van Rossum <guido@python.org>
date Wed, 09 Apr 2003 19:06:21 +0000
parents b14d6741f496
children a4154dd5939a
line wrap: on
line diff
--- a/Python/ceval.c	Wed Apr 09 18:15:57 2003 +0000
+++ b/Python/ceval.c	Wed Apr 09 19:06:21 2003 +0000
@@ -3024,6 +3024,24 @@
 	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)