Add an objfile getter to gdb.Type

This allows users of the Python API to find the objfile where a type
was defined.

gdb/ChangeLog:

gdb/ChangeLog
2019-06-04  Christian Biesinger  <cbiesinger@google.com>

	Add objfile property to gdb.Type.
	* gdb/NEWS: Mention Python API addition.
	* gdb/python/py-type.c (typy_get_objfile): New method.

gdb/doc/ChangeLog
2019-06-04  Christian Biesinger  <cbiesinger@google.com>

	* gdb/doc/python.texi: Document new gdb.Type.objfile property.

gdb/testsuite/ChangeLog
2019-06-04  Christian Biesinger  <cbiesinger@google.com>

	* gdb/testsuite/gdb.python/py-type.exp: Test for new
	  gdb.Type.objfile property.
This commit is contained in:
Christian Biesinger via gdb-patches
2019-05-23 16:37:29 -05:00
committed by Tom Tromey
parent a9d96ab97e
commit e1f2e1a2da
7 changed files with 41 additions and 0 deletions

View File

@@ -1087,6 +1087,11 @@ languages have this concept. If this type has no tag name, then
@code{None} is returned.
@end defvar
@defvar Type.objfile
The @code{gdb.Objfile} that this type was defined in, or @code{None} if
there is no associated objfile.
@end defvar
The following methods are provided:
@defun Type.fields ()