From 8465445732dc04c3fb6cf954274e12d06b274f08 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 13 Jan 2016 10:56:06 +0000 Subject: Add Python InferiorThread.inferior attribute So a script can easily get at a thread's inferior and its number. gdb/ChangeLog: 2016-01-13 Pedro Alves * NEWS: Mention InferiorThread.inferior. * python/py-infthread.c (thpy_get_inferior): New. (thread_object_getset): Register "inferior". gdb/testsuite/ChangeLog: 2016-01-13 Pedro Alves * gdb.python/py-infthread.exp: Test InferiorThread.inferior. gdb/doc/ChangeLog: 2016-01-13 Pedro Alves * python.texi (Threads In Python): Document InferiorThread.inferior. --- gdb/doc/ChangeLog | 5 +++++ gdb/doc/python.texi | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'gdb/doc') diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index b51e8df..be16225 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,5 +1,10 @@ 2016-01-13 Pedro Alves + * python.texi (Threads In Python): Document + InferiorThread.inferior. + +2016-01-13 Pedro Alves + * gdb.texinfo (Inferiors and Programs): Document the $_inferior convenience variable. (Convenience Vars): Likewise. diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index e749810..855da44 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -3006,6 +3006,11 @@ Either the LWPID or TID may be 0, which indicates that the operating system does not use that identifier. @end defvar +@defvar InferiorThread.inferior +The inferior this thread belongs to. This attribute is represented as +a @code{gdb.Inferior} object. This attribute is not writable. +@end defvar + A @code{gdb.InferiorThread} object has the following methods: @defun InferiorThread.is_valid () -- cgit v1.1