diff options
Diffstat (limited to 'gdb/python/py-xmethods.c')
-rw-r--r-- | gdb/python/py-xmethods.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/python/py-xmethods.c b/gdb/python/py-xmethods.c index c3ca75a..6505d06 100644 --- a/gdb/python/py-xmethods.c +++ b/gdb/python/py-xmethods.c @@ -308,6 +308,9 @@ gdbpy_get_xmethod_arg_types (const struct extension_language_defn *extlang, 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; @@ -319,8 +322,6 @@ gdbpy_get_xmethod_arg_types (const struct extension_language_defn *extlang, 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) |