From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3949 invoked by alias); 26 Jul 2002 22:02:53 -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 3942 invoked from network); 26 Jul 2002 22:02:52 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 26 Jul 2002 22:02:52 -0000 Received: from redhat.com (reddwarf.sfbay.redhat.com [172.16.24.50]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id PAA22696; Fri, 26 Jul 2002 15:02:50 -0700 (PDT) Message-ID: <3D41C2D7.49537121@redhat.com> Date: Fri, 26 Jul 2002 15:02:00 -0000 From: Michael Snyder Organization: Red Hat, Inc. X-Accept-Language: en MIME-Version: 1.0 To: Andrew Cagney CC: Anthony Green , gdb@sources.redhat.com Subject: Re: naming command arguments References: <1027556059.2082.179.camel@dhcppc2> <3D408887.70003@ges.redhat.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-07/txt/msg00294.txt.bz2 Andrew Cagney wrote: > > > I've been talking to some GDB users who are frustrated with some of > > GDB's command syntax. My understanding is that optional command > > arguments must be the last possible arguments, and they get dropped off > > right to left. The problem is that some GDB commands have multiple > > arguments, all of which make sense to be optional, but in no particular > > order. > > > > So, for instance, the restore command looks something like: > > > > restore FILENAME [OFFSET [START [STOP]]] > > > > In this case, if you only want to specify the START argument, your > > forced to give OFFSET argument. > > > > They're suggestion, which seems to make sense to me, is to introduce the > > concept of named parameters for GDB commands. So, in my previous > > example, they could simply write... > > > > restore FILENAME start:VALUE > > > > ...and let GDB make reasonable assumptions about OFFSET and STOP > > > > How do people feel about introducing these kinds of arguments to certain > > GDB commands (like restore)? > > For this specific case, how does one differentiate between: > > start:1 > > the source and line specification and: > > start:1 > > the start:VALUE? For this specific case, the command doesn't accept line specs. Only integer expressions interpretted as addresses. > GDB desperatly needs a command line syntax that better allows the > specification of optional information but it needs to be chosen very > carefully. > > Other options to consider: > > restore/start:VALUE FILE > restore --start=VALUE FILE > > etc. > > Andrew