aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2010-08-23 20:23:55 +0000
committerTom Tromey <tromey@redhat.com>2010-08-23 20:23:55 +0000
commit05d0e1e74e28e8b02bd0a79c04a7a3f960b8000b (patch)
tree17cc48eaadaf850cba3d41a8e24c3d1e9901e52e
parent702c27113693b383728d0b423f58389544a80614 (diff)
downloadgdb-05d0e1e74e28e8b02bd0a79c04a7a3f960b8000b.zip
gdb-05d0e1e74e28e8b02bd0a79c04a7a3f960b8000b.tar.gz
gdb-05d0e1e74e28e8b02bd0a79c04a7a3f960b8000b.tar.bz2
PR python/10953:
* python/py-type.c (typy_fields): Call check_typedef. (typy_template_argument): Add TRY_CATCH.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/python/py-type.c17
2 files changed, 20 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9aaa486..37cf16a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2010-08-23 Tom Tromey <tromey@redhat.com>
+ PR python/10953:
+ * python/py-type.c (typy_fields): Call check_typedef.
+ (typy_template_argument): Add TRY_CATCH.
+
+2010-08-23 Tom Tromey <tromey@redhat.com>
+
PR python/11915:
* python/py-type.c (typy_array): New function.
(type_object_methods): Add "array".
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index ea6c8e5..b304310 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 --