struct xmethod_worker *worker,
int *nargs, struct type ***arg_types)
{
+ /* The gdbpy_enter object needs to be placed first, so that it's the last to
+ be destroyed. */
+ gdbpy_enter enter_py (get_current_arch (), current_language);
struct gdbpy_worker_data *worker_data
= (struct gdbpy_worker_data *) worker->data;
PyObject *py_worker = worker_data->worker;
an invalid/unusable number of arg types. */
*nargs = -1;
- gdbpy_enter enter_py (get_current_arch (), current_language);
-
gdbpy_ref get_arg_types_method
(PyObject_GetAttrString (py_worker, get_arg_types_method_name));
if (get_arg_types_method == NULL)