Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Marc Khouzam <marc.khouzam@ericsson.com>
Subject: Re: [MI][patch] broken -target-detach
Date: Fri, 15 Oct 2010 23:47:00 -0000	[thread overview]
Message-ID: <201010160047.03094.pedro@codesourcery.com> (raw)
In-Reply-To: <F7CE05678329534C957159168FA70DEC571AA1B55A@EUSAACMS0703.eamcs.ericsson.se>

On Monday 27 September 2010 21:25:27, Marc Khouzam wrote:
> Hi,
> 
> with GDB 7.2, the MI command -target-detach is not working very well.
> It still assumes that the thread-group id is a pid, instead of the
> new thread-group id format which starts with an 'i'.
> Also, the usage printout does not correspond to the documentation:
> 
> Usage: -target-detach [thread-group]
> vs
> -target-detach [ pid | gid ]

Yeah.  I think it used to correspond implicitly, since the thread
group id in 7.0 and 7.1 was actually equal to the pid, IIRC.  With
7.2, the 1-1 correspondence disappeared, but this command appears
to have been forgotten.

One would hope that frontends would stop using the PID form,
cause you may want to detach from targets that don't have
a PID concept at all, and even though GDB fakes a PID for
you today in such cases, it's better to not assume that.

Unfortunately, 7.2 was released accepting the PID form only,
so we may be better off continue accepting it...

> I have a patch that fixes things to parse both a pid or a thread-group.
> I've added it at the bottom, but I'm not sure it is the right approach.
> With the new global MI flag --thread-group, I wonder if -target-detach
> should take a thread-group as a parameter anymore.
> Note that although "-target-detach i1" does not work,
> "-target-detach --thread-group i1" works.
> I'm not sure what would happen if I did:
> "-target-detach --thread-group i1 <pid or threadGroupId>"
> I'm guessing the --thread-group flag would get ignored.
> 
> What should we do about this?

FWIW, codewise, your patch also looked good to me.
(though IMO it'd be clearer to check for *argv[0] == 'i' even
before trying to parse a number with strtol.)

-- 
Pedro Alves


  parent reply	other threads:[~2010-10-15 23:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-28  9:21 Marc Khouzam
2010-09-30 10:25 ` Marc Khouzam
2010-10-12 22:51   ` Tom Tromey
2010-10-15 23:47 ` Pedro Alves [this message]
2010-11-12 16:02   ` Marc Khouzam
2010-11-12 16:43     ` Pedro Alves
2010-11-12 19:07       ` Marc Khouzam

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=201010160047.03094.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=marc.khouzam@ericsson.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