Hi Fabio,
Right, the PyInterpreterState structure is now opaque. You need to
include pycore_pystate.h which requires to define the
Py_BUILD_CORE_MODULE macro. That's the internal C API which "should
not be used", but it's ok to use it for very specific use cases, like
debuggers.
Maybe we should provide an interpreter method to set
interp->eval_frame, to avoid to pull the annoying internal C API.
Victor
Le mer. 16 oct. 2019 à 15:47, Fabio Zadrozny
Hi All,
I'm trying to upgrade the pydevd debugger to the latest version of CPython (3.8), however I'm having some issues being able to access `PyInterpreterState.eval_frame` when compiling, so, I'd like to ask if someone can point me in the right direction.
What I'm trying to do is compile something like:
#include "pystate.h" ... PyThreadState *ts = PyThreadState_Get(); PyInterpreterState *interp = ts->interp; interp->eval_frame = my_frame_eval_func;
and the error I'm having is:
_pydevd_frame_eval/pydevd_frame_evaluator.c(7534): error C2037: left of 'eval_frame' specifies undefined struct/union '_is'
So, it seems that now "pystate.h" only has a forward reference to "_is" and a typedef from " PyInterpreterState" to "_is" and "_is" is defined in "include/internal/pycore_pystate.h", which doesn't seem like I should be including (in fact, if I try to include it I get an error saying that I would need to define Py_BUILD_CORE)... so, can someone point me to the proper way to set the frame evaluation function on CPython 3.8?
Thanks,
Fabio _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/BJAO35DB... Code of Conduct: http://python.org/psf/codeofconduct/
-- Night gathers, and now my watch begins. It shall not end until my death.