From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19217 invoked by alias); 24 Mar 2009 17:27:25 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 19184 invoked by uid 306); 24 Mar 2009 17:27:24 -0000 Date: Tue, 24 Mar 2009 17:27:00 -0000 Message-ID: <20090324172724.19169.qmail@sourceware.org> From: tromey@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-tromey-python: gdb X-Git-Refname: refs/heads/archer-tromey-python X-Git-Reftype: branch X-Git-Oldrev: cb27ee6e1ada4fd6992dd51da402baef10ad88e3 X-Git-Newrev: cb7eaa7343fa9fa04f8deee2471b85be2b44fe13 X-SW-Source: 2009-q1/txt/msg00363.txt.bz2 List-Id: The branch, archer-tromey-python has been updated via cb7eaa7343fa9fa04f8deee2471b85be2b44fe13 (commit) from cb27ee6e1ada4fd6992dd51da402baef10ad88e3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit cb7eaa7343fa9fa04f8deee2471b85be2b44fe13 Author: Tom Tromey Date: Tue Mar 24 11:26:59 2009 -0600 gdb * python/python-type.c (convert_field): Handle a NULL type. gdb/doc * gdb.texinfo (Types From Inferior): Update. ----------------------------------------------------------------------- Summary of changes: gdb/doc/gdb.texinfo | 3 ++- gdb/python/python-type.c | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) First 500 lines of diff: diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 7c01732..af3d12b 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -18522,7 +18522,8 @@ non-zero value, which is the size of the field in bits. Otherwise, this will be zero; in this case the field's size is given by its type. @item type -The type of the field. +The type of the field. This is usually an instance of @code{Type}, +but it can be @code{None} in some situations. @end table @end defmethod diff --git a/gdb/python/python-type.c b/gdb/python/python-type.c index d336456..2a54556 100644 --- a/gdb/python/python-type.c +++ b/gdb/python/python-type.c @@ -175,7 +175,14 @@ convert_field (struct type *type, int field) if (PyObject_SetAttrString (result, "bitsize", arg) < 0) goto failarg; - arg = type_to_type_object (TYPE_FIELD_TYPE (type, field)); + /* A field can have a NULL type in some situations. */ + if (TYPE_FIELD_TYPE (type, field) == NULL) + { + arg = Py_None; + Py_INCREF (arg); + } + else + arg = type_to_type_object (TYPE_FIELD_TYPE (type, field)); if (!arg) goto fail; if (PyObject_SetAttrString (result, "type", arg) < 0) hooks/post-receive -- Repository for Project Archer.