From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16901 invoked by alias); 13 Jul 2005 22:55:58 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 16888 invoked by uid 22791); 13 Jul 2005 22:55:54 -0000 Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 13 Jul 2005 22:55:54 +0000 Received: from farnswood.snap.net.nz (p213-tnt1.snap.net.nz [202.124.110.213]) by viper.snap.net.nz (Postfix) with ESMTP id C8DE95BF98F; Thu, 14 Jul 2005 10:55:50 +1200 (NZST) Received: by farnswood.snap.net.nz (Postfix, from userid 501) id 585BE62A99; Wed, 13 Jul 2005 23:57:14 +0100 (BST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17109.40009.659224.609729@farnswood.snap.net.nz> Date: Wed, 13 Jul 2005 22:55:00 -0000 To: Bob Rossi Cc: gdb@sources.redhat.com Subject: Re: -inferior-tty-show and -inferior-tty-set In-Reply-To: <20050713224555.GA5383@white> References: <17108.33601.794016.525239@farnswood.snap.net.nz> <20050713224555.GA5383@white> X-SW-Source: 2005-07/txt/msg00160.txt.bz2 > 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. Nick