diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-02-14 17:02:03 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-02-28 17:01:31 +0000 |
commit | 659971cb0f8fd749aa951221d99de2868a860d07 (patch) | |
tree | a8d9a06e3d9b934d302dd05440c213b9ea35e3c9 /gdb/doc | |
parent | ea764154c27a11619ba764a4c92f395ba5007234 (diff) | |
download | fsf-binutils-gdb-659971cb0f8fd749aa951221d99de2868a860d07.zip fsf-binutils-gdb-659971cb0f8fd749aa951221d99de2868a860d07.tar.gz fsf-binutils-gdb-659971cb0f8fd749aa951221d99de2868a860d07.tar.bz2 |
gdb/python: Add gdb.InferiorThread.details attribute
This adds a new read-only attribute gdb.InferiorThread.details, this
attribute contains a string, the results of target_extra_thread_info
for the thread, or None, if target_extra_thread_info returns nullptr.
As the string returned by target_extra_thread_info is unstructured,
this attribute is only really useful for echoing straight through to
the user, but, if a user wants to write a command that displays the
same, or a similar 'Thread Id' to the one seen in 'info threads', then
they need access to this string.
Given that the string produced by target_extra_thread_info varies by
target, there's only minimal testing of this attribute, I check that
the attribute can be accessed, and that the return value is either
None, or a string.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/gdb.texinfo | 2 | ||||
-rw-r--r-- | gdb/doc/python.texi | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 504eb66..f7f5f7a 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -3629,6 +3629,7 @@ Thread 1 "main" received signal SIGINT, Interrupt. @end smallexample @table @code +@anchor{info_threads} @kindex info threads @item info threads @r{[}@var{thread-id-list}@r{]} @@ -42719,6 +42720,7 @@ encoded). @value{GDBN} will continue to supply the values of symbols @xref{Tracepoint Packets}. +@anchor{qThreadExtraInfo} @item qThreadExtraInfo,@var{thread-id} @cindex thread attributes info, remote request @cindex @samp{qThreadExtraInfo} packet diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index c1a3f5f..4d9e77b 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -3574,6 +3574,23 @@ The inferior this thread belongs to. This attribute is represented as a @code{gdb.Inferior} object. This attribute is not writable. @end defvar +@defvar InferiorThread.details +A string containing target specific thread state information. The +format of this string varies by target. If there is no additional +state information for this thread, then this attribute contains +@code{None}. + +For example, on a @sc{gnu}/Linux system, a thread that is in the +process of exiting will return the string @samp{Exiting}. For remote +targets the @code{details} string will be obtained with the +@samp{qThreadExtraInfo} remote packet, if the target supports it +(@pxref{qThreadExtraInfo,,@samp{qThreadExtraInfo}}). + +@value{GDBN} displays the @code{details} string as part of the +@samp{Target Id} column, in the @code{info threads} output +(@pxref{info_threads,,@samp{info threads}}). +@end defvar + A @code{gdb.InferiorThread} object has the following methods: @defun InferiorThread.is_valid () |