This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 02/12] Generalize varobj iterator


>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

Yao> On 05/22/2014 01:51 AM, Tom Tromey wrote:
Yao> +static void
Yao> +py_varobj_iter_dtor (struct varobj_iter *self)
Yao> +{
Yao> +  struct py_varobj_iter *dis = (struct py_varobj_iter *) self;
Yao> +
Yao> +  Py_XDECREF (dis->iter);

Tom> I think this has to acquire the GIL before calling Py_XDECREF.

Yao> PyGILState_Ensure and PyGILState_Release are added.

I think all transitions from gdb->python should use ensure_python_env.
That way the other things needed by gdb's python layer are guaranteed to
be set.

In this situation I think it could potentially cause a problem if
Py_XDECREF calls a user-written __del__ method somewhere.

thanks,
Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]