public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Andrew Burgess <aburgess@redhat.com>, Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCHv2] gdb/python: Add gdb.InferiorThread.details attribute
Date: Mon, 28 Feb 2022 09:52:56 -0500	[thread overview]
Message-ID: <5d7386a1-973f-9c56-d82c-a30f80c22523@polymtl.ca> (raw)
In-Reply-To: <20220228113029.GA1212730@redhat.com>



On 2022-02-28 06:30, Andrew Burgess via Gdb-patches wrote:
> * Tom Tromey <tom@tromey.com> [2022-02-25 12:33:42 -0700]:
> 
>>>>>>> "Andrew" == Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> writes:
>>
>> Andrew> As the string returned by target_extra_thread_info is unstructured,
>> Andrew> this attribute is only really useful for echoing straight through to
>> Andrew> the user, but, if a user wants to write a command that displays the
>> Andrew> same, or a similar 'Thread Id' to the one seen in 'info threads', then
>> Andrew> they need access to this string.
>>
>> It may be good to give a bit more information about this in the
>> documentation.  Like, describing what this is used for and maybe how it
>> would appear on a Linux system.
>>
>> Andrew> +  const char *extra_info = target_extra_thread_info (thread_obj->thread);
>>
>> If this can ever throw, it will break things here.
> 
> Thanks for the feedback.  In v2:
> 
>   - Improved the docs to given an example of what the string might
>     contain, and where GDB currently displays the string, and
> 
>   - Use try/catch and GDB_PY_HANDLE_EXCEPTION in py-infthread.c in
>     to handle any exceptions thrown from GDB core.
> 
> Thanks,
> Andrew
> 
> ---
> 
> 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.

This LGTM, thanks.

Simon

      parent reply	other threads:[~2022-02-28 14:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 11:52 [PATCH] " Andrew Burgess
2022-02-25 19:33 ` Tom Tromey
2022-02-28 11:30   ` [PATCHv2] " Andrew Burgess
2022-02-28 12:39     ` Eli Zaretskii
2022-02-28 14:52     ` Simon Marchi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d7386a1-973f-9c56-d82c-a30f80c22523@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).