From 22a0232400ea09c57ab70d97cffc1f25e6320da7 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 13 Jan 2016 10:56:08 +0000 Subject: Add Python InferiorThread.global_num attribute This commit adds a new Python InferiorThread.global_num attribute. This can be used to pass the correct thread ID to Breakpoint.thread, which takes a global thread ID, not a per-inferior thread number. gdb/ChangeLog: 2016-01-13 Pedro Alves * NEWS: Mention InferiorThread.global_num. * python/py-infthread.c (thpy_get_global_num): New function. (thread_object_getset): Register "global_num". gdb/testsuite/ChangeLog: 2016-01-13 Pedro Alves * gdb.multi/tids.exp: Test InferiorThread.global_num and Breakpoint.thread. * gdb.python/py-infthread.exp: Test InferiorThread.global_num. gdb/doc/ChangeLog: 2016-01-13 Pedro Alves * python.texi (Breakpoints In Python) : Add anchor. (Threads In Python): Document new InferiorThread.global_num attribute. --- gdb/doc/ChangeLog | 7 +++++++ gdb/doc/python.texi | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'gdb/doc') diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 46207f6..65f8ed9 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,10 @@ +2016-01-13 Pedro Alves + + * python.texi (Breakpoints In Python) : Add + anchor. + (Threads In Python): Document new InferiorThread.global_num + attribute. + 2016-01-07 Pedro Alves * gdb.texinfo (Threads): Document per-inferior thread IDs, diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index f9f9e5b..ffbf89a 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -2998,6 +2998,12 @@ user-specified thread name. The per-inferior number of the thread, as assigned by GDB. @end defvar +@defvar InferiorThread.global_num +The global ID of the thread, as assigned by GDB. You can use this to +make Python breakpoints thread-specific, for example +(@pxref{python_breakpoint_thread,,The Breakpoint.thread attribute}). +@end defvar + @defvar InferiorThread.ptid ID of the thread, as assigned by the operating system. This attribute is a tuple containing three integers. The first is the Process ID (PID); the second @@ -4642,6 +4648,7 @@ first command is @code{silent}. This is not reported by the @code{silent} attribute. @end defvar +@anchor{python_breakpoint_thread} @defvar Breakpoint.thread If the breakpoint is thread-specific, this attribute holds the thread's global id. If the breakpoint is not thread-specific, this -- cgit v1.1