Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Per-inferior thread IDs
Date: Fri, 18 Dec 2015 18:47:00 -0000	[thread overview]
Message-ID: <567454C2.1000502@redhat.com> (raw)
In-Reply-To: <20151218175307.GC29928@adacore.com>

On 12/18/2015 05:53 PM, Joel Brobecker wrote:
>> However, before I dig deeper, I thought I'd post this for feedback.
> 
> FWIW, I think that this is a fairly nice way of addressing the problem!
> 
> The only question I have is that I'm a little unclear as to what
> it will look like with GDB/MI. From what I can tell, there is no
> real change at all, meaning that the "thread-id" is the thread's
> global ID. 

Exactly, no change at all.

> But perhaps it wouuld be nice to add an extra field
> giving the thread's ID in string form.  Newer IDEs knowing about
> this new feature would then have an easy way to present the list
> of threads using the same representation as the one we see with
> the CLI interface. Just a thought...

Yeah.

> 
> Another way would be to provide the per-inferior-thread-id in numeric
> form, which should be sufficient, since I think the inferior-id is
> already provided.  It has a cleaner feel to it, but on the other hand,
> it forces the IDEs to rebuild the thread ID by hand - which is not so
> simple, since we have this exception where if there is one inferior
> whose ID is 1, we don't use the composite thread ID.

Indeed, hadn't thought of that point.

In an earlier revision of the patch I followed the numeric approach.
I had a couple new fields to -thread-info output, like:

 - ^done,threads=[{id="6", ...} ...
 + ^done,threads=[{thread-group="i2", per-tg-id="3",id="6", ...} ...

and:

 - =thread-created,id=3,group-id="i2"
 + =thread-created,id=3,group-id="i2",per-tg-id="3"

But after chatting with Marc Khouzam (Eclipse CDT) about the whole
change's impact, we came to the conclusion that we can add this later
when we find a needed.  So I left that out of the patch for now.

Maybe we should need the new field in the =thread-created event,
not sure.  Or we go through everywhere and make sure we're consistent.
I'm just dodging thinking about all that for now.  :-)

> 
> That being said, maybe the IDEs don't even (need to) display
> that ID... So we could also leave that question open for debate
> when the need actually materializes...
> 

That's my hope. :-)

Thanks,
Pedro Alves


      reply	other threads:[~2015-12-18 18:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15 19:05 Pedro Alves
2015-12-15 19:39 ` Eli Zaretskii
2015-12-17 13:17   ` Pedro Alves
2015-12-17 16:54     ` Eli Zaretskii
2015-12-18 18:11       ` Pedro Alves
2015-12-18 19:36         ` Eli Zaretskii
2015-12-24 14:56         ` [PATCH] thread ID ranges (Per-inferior thread IDs) Pedro Alves
2015-12-24 16:24           ` Eli Zaretskii
2015-12-18 17:53 ` [PATCH] Per-inferior thread IDs Joel Brobecker
2015-12-18 18:47   ` Pedro Alves [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=567454C2.1000502@redhat.com \
    --to=palves@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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