Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Cleber Rosa <crosa@redhat.com>, gdb-patches@sourceware.org
Cc: areis@redhat.com
Subject: Re: [PATCH 2/4] GDB/MI: fix and simplify mi_valid_noargs utility function
Date: Wed, 21 Oct 2015 11:19:00 -0000	[thread overview]
Message-ID: <56276B66.8000908@redhat.com> (raw)
In-Reply-To: <1444045617-14526-3-git-send-email-crosa@redhat.com>

On 10/05/2015 12:46 PM, Cleber Rosa wrote:

...

> If the command should take no arguments, then it should be OK to just
> check the given argument count.

...

> 
> diff --git a/gdb/mi/mi-getopt.c b/gdb/mi/mi-getopt.c
> index 0a07a39..574ccd2 100644
> --- a/gdb/mi/mi-getopt.c
> +++ b/gdb/mi/mi-getopt.c
> @@ -95,18 +95,14 @@ mi_getopt_allow_unknown (const char *prefix, int argc, char **argv,
>    return mi_getopt_1 (prefix, argc, argv, opts, oind, oarg, 0);
>  }
>  
> +/* Tests if a command that takes no arguments was properly used.
> +   Returns 1 if no options were given, otherwise return 0.  */

This function is already documented in mi-getopt.h.  Any comment
here should just be "/* See mi-getopt.h.  */"

But the comment in mi-getopt.h says:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/* mi_valid_noargs determines if ARGC/ARGV are a valid set of
   parameters to satisfy an MI function that is not supposed to
   recieve any arguments.

   An MI function that should not receive arguments can still be
   passed parameters after the special option '--' such as below.

   Example: The MI function -exec-run takes no args.
   However, the client may pass '-exec-run -- -a ...'
   See PR-783

   PREFIX is passed to mi_getopt for an error message.

   This function Returns 1 if the parameter pair ARGC/ARGV are valid
   for an MI function that takes no arguments. Otherwise, it returns 0
   and the appropriate error message is displayed by mi_getopt.  */

extern int mi_valid_noargs (const char *prefix, int argc, char **argv);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sounds like that conflicts with your patch?

Thanks,
Pedro Alves


  reply	other threads:[~2015-10-21 10:39 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-05 11:47 [PATCH 0/4]: GDB: inferior standard I/O redirection Cleber Rosa
2015-10-05 11:47 ` [PATCH 1/4] " Cleber Rosa
2015-10-05 12:23   ` Eli Zaretskii
2015-10-21 11:18   ` Pedro Alves
2015-10-05 11:47 ` [PATCH 3/4] GDB/MI: add test for command -inferior-tty-show Cleber Rosa
2015-10-21 11:19   ` Pedro Alves
2015-10-05 11:47 ` [PATCH 2/4] GDB/MI: fix and simplify mi_valid_noargs utility function Cleber Rosa
2015-10-21 11:19   ` Pedro Alves [this message]
2015-10-05 11:54 ` [PATCH 4/4] GDB/MI: inferior standard I/O redirection Cleber Rosa
2015-10-05 12:26   ` Eli Zaretskii
2015-10-21 11:19   ` Pedro Alves
2015-10-22 10:55   ` Vladimir Prus

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=56276B66.8000908@redhat.com \
    --to=palves@redhat.com \
    --cc=areis@redhat.com \
    --cc=crosa@redhat.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