From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9270 invoked by alias); 13 Jul 2005 23:39:36 -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 9247 invoked by uid 22791); 13 Jul 2005 23:39:30 -0000 Received: from lakermmtao12.cox.net (HELO lakermmtao12.cox.net) (68.230.240.27) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 13 Jul 2005 23:39:30 +0000 Received: from white ([68.9.64.121]) by lakermmtao12.cox.net (InterMail vM.6.01.04.00 201-2131-118-20041027) with ESMTP id <20050713233924.KPPR10527.lakermmtao12.cox.net@white>; Wed, 13 Jul 2005 19:39:24 -0400 Received: from bob by white with local (Exim 3.35 #1 (Debian)) id 1Dsqp2-0001Qy-00; Wed, 13 Jul 2005 19:39:24 -0400 Date: Wed, 13 Jul 2005 23:39:00 -0000 From: Bob Rossi To: Nick Roberts Cc: gdb@sources.redhat.com Subject: Re: -inferior-tty-show and -inferior-tty-set Message-ID: <20050713233924.GB5383@white> Mail-Followup-To: Nick Roberts , gdb@sources.redhat.com References: <17108.33601.794016.525239@farnswood.snap.net.nz> <20050713224555.GA5383@white> <17109.40009.659224.609729@farnswood.snap.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <17109.40009.659224.609729@farnswood.snap.net.nz> User-Agent: Mutt/1.3.28i X-SW-Source: 2005-07/txt/msg00161.txt.bz2 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