diff options
author | Tom Tromey <tromey@redhat.com> | 2010-08-23 20:23:54 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2010-08-23 20:23:54 +0000 |
commit | 90f5af282d2955c84854332e42653d5e7c26bb7f (patch) | |
tree | de80cd64a516132e6ac216aebe3716ad59cd2271 /gdb/python/py-type.c | |
parent | bae23351f8599a031ac17a6aebf44ef87038b269 (diff) | |
download | gdb-90f5af282d2955c84854332e42653d5e7c26bb7f.tar.gz |
PR python/10953:
* python/py-type.c (typy_fields): Call check_typedef.
(typy_template_argument): Add TRY_CATCH.
Diffstat (limited to 'gdb/python/py-type.c')
-rw-r--r-- | gdb/python/py-type.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index ea6c8e53cb4..b3043109632 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -216,6 +216,13 @@ typy_fields (PyObject *self, PyObject *args) PyObject *result; int i; struct type *type = ((type_object *) self)->type; + volatile struct gdb_exception except; + + TRY_CATCH (except, RETURN_MASK_ALL) + { + CHECK_TYPEDEF (type); + } + GDB_PY_HANDLE_EXCEPTION (except); /* We would like to make a tuple here, make fields immutable, and then memoize the result (and perhaps make Field.type() lazy). @@ -641,9 +648,13 @@ typy_template_argument (PyObject *self, PyObject *args) } } - type = check_typedef (type); - if (TYPE_CODE (type) == TYPE_CODE_REF) - type = check_typedef (TYPE_TARGET_TYPE (type)); + TRY_CATCH (except, RETURN_MASK_ALL) + { + type = check_typedef (type); + if (TYPE_CODE (type) == TYPE_CODE_REF) + type = check_typedef (TYPE_TARGET_TYPE (type)); + } + GDB_PY_HANDLE_EXCEPTION (except); /* We might not have DW_TAG_template_*, so try to parse the type's name. This is inefficient if we do not have a template type -- |