public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Kevin Buettner <kevinb@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 4/4] Documentation for python method InferiorThread.thread_handle
Date: Tue, 18 Sep 2018 11:16:00 -0000	[thread overview]
Message-ID: <87va73t5se.fsf@tromey.com> (raw)
In-Reply-To: <20180915221847.27a1d50b@pinnacle.lan> (Kevin Buettner's message	of "Sat, 15 Sep 2018 22:18:47 -0700")

>>>>> "Kevin" == Kevin Buettner <kevinb@redhat.com> writes:

Kevin> +@defun InferiorThread.thread_handle (type)
Kevin> +Return the thread object's handle.  Since handles are generally opaque
Kevin> +objects, the type @var{type} is used to ensure that the correct amount
Kevin> +of space is allocated for the returned handle value.  When using handles
Kevin> +associated with the pthreads library, the value passed for @var{type}
Kevin> +should be the result of invoking @code{gdb.lookup_type('pthread_t')}.
Kevin> +@end defun

This API requires the Python programmer to know the type of the
inferior's thread ID.  However, it seems to me that the target also
knows it, or should know it, and so there should be no reason to pass in
the type.

But if a handle is supposed to be opaque, why have a type at all?  It
could just be a bunch of bytes, or even just some completely opaque
object...  but if a completely opaque object would do, why not use the
InferiorThread itself?

I think the code patches all look good.  I didn't even have any nits.
However, exposing some API to Python is more of a commitment and so I'd
like to understand this area and come to an agreement about how it
should work before anything here goes in.

thanks,
Tom

  parent reply	other threads:[~2018-09-18 11:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-16  5:08 [PATCH 0/4] Add python method gdb.InferiorThread.thread_handle Kevin Buettner
2018-09-16  5:16 ` [PATCH 1/4] Add and implement thread_to_thread_handle Kevin Buettner
2018-09-16  5:17 ` [PATCH 3/4] Tests for gdb.InfThread.thread_handle Kevin Buettner
2018-09-16  5:17 ` [PATCH 2/4] Add python method gdb.InferiorThread.thread_handle Kevin Buettner
2018-09-16  5:19 ` [PATCH 4/4] Documentation for python method InferiorThread.thread_handle Kevin Buettner
2018-09-16 16:04   ` Eli Zaretskii
2018-09-18 11:16   ` Tom Tromey [this message]
2018-09-20  0:03     ` Kevin Buettner
2018-09-18 11:03 ` [PATCH 0/4] Add python method gdb.InferiorThread.thread_handle Tom Tromey
2018-09-19 23:53   ` Kevin Buettner

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=87va73t5se.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.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).