From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12383 invoked by alias); 13 Jul 2005 22:46:01 -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 12352 invoked by uid 22791); 13 Jul 2005 22:45:57 -0000 Received: from lakermmtao02.cox.net (HELO lakermmtao02.cox.net) (68.230.240.37) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 13 Jul 2005 22:45:57 +0000 Received: from white ([68.9.64.121]) by lakermmtao02.cox.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050713224553.JDNL13515.lakermmtao02.cox.net@white>; Wed, 13 Jul 2005 18:45:53 -0400 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1DspzH-0001Q5-00; Wed, 13 Jul 2005 18:45:55 -0400 Date: Wed, 13 Jul 2005 22:46:00 -0000 From: Bob Rossi To: Nick Roberts Cc: gdb@sources.redhat.com Subject: Re: -inferior-tty-show and -inferior-tty-set Message-ID: <20050713224555.GA5383@white> Mail-Followup-To: Nick Roberts , gdb@sources.redhat.com References: <17108.33601.794016.525239@farnswood.snap.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17108.33601.794016.525239@farnswood.snap.net.nz> User-Agent: Mutt/1.3.28i X-SW-Source: 2005-07/txt/msg00159.txt.bz2 On Wed, Jul 13, 2005 at 02:58:09PM +1200, Nick Roberts wrote: > > -inferior-tty-show and -inferior-tty-set seem to accept any number of > arguments: > > (gdb) > -inferior-tty-show asdf > ^done > (gdb) > > (gdb) > -inferior-tty-set asdf qwert > ^done > (gdb) > > With mi_cmd_inferior_tty_set there is no test. mi_cmd_inferior_tty_show > uses mi_valid_noargs which returns 1 even with arguments (mi_getopt > only returns something other than -1 if it finds an option i.e an argument > starting with `-'). 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. Bob Rossi