public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Bob Rossi <bob@brasko.net>
To: Nick Roberts <nickrob@snap.net.nz>
Cc: gdb@sources.redhat.com
Subject: Re: -inferior-tty-show and -inferior-tty-set
Date: Wed, 13 Jul 2005 23:39:00 -0000	[thread overview]
Message-ID: <20050713233924.GB5383@white> (raw)
In-Reply-To: <17109.40009.659224.609729@farnswood.snap.net.nz>

On Thu, Jul 14, 2005 at 10:57:13AM +1200, Nick Roberts wrote:
>  > OK. There could be a problem here. Not sure. A valid MI option is,
>  >  mi-command ==>
>  >   [ token ] "-" operation ( " " option )* [ " --" ] ( " " parameter )* nl
>  > basically, arguments to an mi function begin with a '-'. 
>  > 
>  > So,
>  >    (gdb)
>  >    -file-list-exec-source-file a
>  >    ^done,line="1",file="test.c",fullname="/home/bob/cvs/gdb/original/objdir/gdb/test.c"
>  >    (gdb)
>  >    -file-list-exec-source-file -a
>  >    &"mi_cmd_file_list_exec_source_file: Unknown option ``a''\n"
>  >    ^error,msg="mi_cmd_file_list_exec_source_file: Unknown option ``a''"
>  >    (gdb)
>  > 
>  > Should we make mi_valid_noargs take care of the case when invalid
>  > arguments are passed to the MI command? or should mi_getopt return an
>  > error? I'll have to think a little about this.
> 
> Instead of
> 
>   if ( !mi_valid_noargs("mi_cmd_file_list_exec_source_file", argc, argv) )
>     error (_("mi_cmd_file_list_exec_source_file: Usage: No args"));
> 
> why not just use:
> 
>   if (argc > 0)
>     error (_("mi_cmd_file_list_exec_source_file: Usage: No args"));
> 
> Incidentally there is no mention of mi_valid_noargs in the ChangeLogs.  If
> the above suggestion works, perhaps its not needed and it could be removed.

Hmmm, I added the mi_valid_noargs as one of my first GDB commits. Don't
know how it didn't get in the change log. 

I think everywhere that does "if (argc >0)" is broke. I could be wrong
about this though. Here is the reason that Andrew asked me to create
this function,
    http://sourceware.org/ml/gdb-patches/2003-04/msg00030.html

Thanks,
Bob Rossi

  reply	other threads:[~2005-07-13 23:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-13  2:57 Nick Roberts
2005-07-13  3:59 ` Daniel Jacobowitz
2005-07-13 22:46 ` Bob Rossi
2005-07-13 22:55   ` Nick Roberts
2005-07-13 23:39     ` Bob Rossi [this message]
2005-07-14  6:36       ` Nick Roberts

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=20050713233924.GB5383@white \
    --to=bob@brasko.net \
    --cc=gdb@sources.redhat.com \
    --cc=nickrob@snap.net.nz \
    /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).