Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Marc Khouzam <marc.khouzam@ericsson.com>
Cc: "'gdb-patches@sourceware.org'" <gdb-patches@sourceware.org>
Subject: Re: [MI] Duplicate --thread-group flag not detected
Date: Fri, 26 Nov 2010 16:39:00 -0000	[thread overview]
Message-ID: <20101126163842.GJ2634@adacore.com> (raw)
In-Reply-To: <F7CE05678329534C957159168FA70DEC572E7598F3@EUSAACMS0703.eamcs.ericsson.se>

> 2010-11-25  Marc Khouzam  <marc.khouzam@ericsson.com>
> 
> 	* mi/mi-parse.c (mi_parse): Missing else.

Normally, the man to approve this is Vladimir, so I can't approve, but
I had a quick look anyway.

I think that the patch above is correct, given the current implementation.
Another very bad scenario:

        <mi-command> --thread-group i1 --all --frame 1 --thread 1

I think that all the options after --thread-group will be ignored.

Speaking of the current implementation:

The whole parsing loop looked very odd at first, but I think I'm starting
to understand how it works, now.  I think it does work right now because
there is only 1 option that takes no argument ("--all").  So the code
'swallows' it first if found, and then checks for the other possible
switches.  It apparently tries to avoid error-handling duplication by
putting it at the end of the looping block, but then that leads to:

      if (*chp != '\0' && !isspace (*chp))
        error (_("Invalid value for the '%s' option"),
               start[2] == 't' ? "--thread" : "--frame");

... which is missing one case: --thread-group. As the number of options
being handled grows (for instance, I have in my TODO an entry for adding
support for "--task"), I think that we're going to have to rewrite this
slightly differently to make it easier to read and extend...

Another remark: It looks like the use of the --all/--thread-group/--thread
options with the -mi-break command is not documented? I could only see
them documented with commands such as -exec-continue....

Last comment: A small test would be nice...

-- 
Joel


  reply	other threads:[~2010-11-26 16:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25 20:56 Marc Khouzam
2010-11-26 16:39 ` Joel Brobecker [this message]
2010-12-02 16:40   ` Tom Tromey
2010-12-02 17:10     ` Joel Brobecker
2010-12-04 18:10       ` Marc Khouzam
2010-12-04 18:47         ` Joel Brobecker
2010-12-05 19:27           ` Marc Khouzam
2010-12-06 11:04             ` Joel Brobecker
2010-12-06 14:26               ` Marc Khouzam
2010-12-06 15:02               ` [MI] --thread-group test (was: RE: [MI] Duplicate --thread-group flag not detected) Marc Khouzam
2010-12-10 12:15                 ` Joel Brobecker

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=20101126163842.GJ2634@adacore.com \
    --to=brobecker@adacore.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