Hi all,
I am developing a new python debugger which is coming on quite nicely
except that f_locals always becomes NULL when entering new functions.
Can anyone help with this? Someone else has posted earlier with a
similar problem but there are no replies. I can't understand why
f_locals would be NULL - it works fine at the module level but as soon
as I "step into" a function, the contents of frame->f_locals when
converted to a string is null. The conversion is as follows:
int tracer(PyObject*, PyFrameObject* frame, int what, PyObject* arg)
{
PyObject* locals = PyObject_Str(frame->f_locals);
std::cout << "LOCALS: " << PyString_AsString(locals) << std::endl;
Py_DECREF(locals);
}
Is there anything wrong with this or can I assume f_locals is actually
NULL?
Note: I have ran the same test module in PDB and it's f_locals is fine!