Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@ges.redhat.com>
To: Daniel Jacobowitz <drow@mvista.com>,
	david carlton <carlton@math.stanford.edu>
Cc: Tom Tromey <tromey@redhat.com>, gdb-patches@sources.redhat.com
Subject: Re: RFA: >, >>, and "tee" operators
Date: Thu, 01 Aug 2002 08:05:00 -0000	[thread overview]
Message-ID: <3D494E38.3080106@ges.redhat.com> (raw)
In-Reply-To: <20020731163628.GA5436@nevyn.them.org>

> On Wed, Jul 31, 2002 at 09:32:19AM -0700, david carlton wrote:
> 
>> So I think that, if this syntax is changed, the fact that expressions
>> could start with unary minus signs is going to cause much less
>> grumbling from users than the fact that, once the old p/x syntax gets
>> obsoleted, they'll have to convert over to typing p -x instead.

DanielJ wrote:

> Which, for the record, I never suggested - I think p/x and log -a are
> different enough uses of options that they can still both exist without
> any real inconsistency.

``log -a'' works because it is ``log -a FILE''.  A leading ``-'' in a 
file name on VMS, DOS and UNIX is very unlikely.

Problems arise when this same syntax is applied to a command that takes 
an expression:

	command -OPTION EXPRESSION

There, as DavidC noted, there is a conflict.  I think the reason (note 
I'm guessing) the ``/'' character was chosen for print et.al. was 
because it didn't conflict with any known expression.

> Don't forget that prefix `-' and `--' are valid C operators.  You
>> can't tell the difference between the above and a valid C
>> expressions.  I think that rules `-...' out.
> 
> 
> It makes '-...' undesirable, but I don't think it rules it out.  Yes,
> there are situations where what had previously been a legitimate print
> statement now becomes either a syntax error or, worse yet, remains
> legitimate but with a different meaning.  But I doubt they are all
> _that_ common, and there is an easy workaround once you're aware of
> this problem, namely enclosing your expression in parentheses.

There is an old rule ``KISS''.  At some point there are too many 
workarounds and edge cases and they are arising too frequently.

To consider a working example, the MI uses ``-''.  The syntax is loose 
enough to allow humans to enter free form commands vis:
	-mi-command -opt optarg param
However, client programs should always generate commands using the more 
robust form:
	-mi-command -opt "optarg" -- "param"
(always include ``--'', encode all parameters as quoted strings.)

--

BTW, simply adding paren around an expression doesn't really help.  GDB 
often parses expressions and files using ``strchr(' ')''.  That means 
that things like:

	EXPRESSION: ("foo bar")
	FILE: "/a b/c"

do not get handled correctly.

Andrew



  reply	other threads:[~2002-08-01 15:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-23 11:51 Daniel Jacobowitz
2002-07-23 12:23 ` Tom Tromey
2002-07-23 13:18   ` Daniel Jacobowitz
2002-07-23 13:20     ` Tom Tromey
2002-07-23 13:58       ` Daniel Jacobowitz
2002-07-24 20:10         ` Andrew Cagney
2002-07-24 20:14           ` Daniel Jacobowitz
2002-07-25  9:17             ` Andrew Cagney
2002-07-25 10:36               ` Daniel Jacobowitz
2002-07-25 10:46                 ` Andrew Cagney
2002-07-30 13:00                   ` Daniel Jacobowitz
2002-07-30 20:36                     ` Andrew Cagney
2002-07-30 20:51                       ` Daniel Jacobowitz
2002-07-30 20:58                         ` Andrew Cagney
2002-07-30 22:45                           ` Daniel Jacobowitz
2002-07-31  9:36                       ` david carlton
2002-07-31  9:39                         ` Daniel Jacobowitz
2002-08-01  8:05                           ` Andrew Cagney [this message]
2002-08-01 10:24                             ` david carlton
2002-08-01 12:03                               ` Daniel Jacobowitz
2002-08-01 12:16                                 ` david carlton
2002-08-13 15:20             ` Fernando Nasser
2002-07-23 14:23       ` Grant Edwards
2002-07-24  1:59 ` Eli Zaretskii
2002-07-24 19:01 ` Andrew Cagney
2002-07-24 22:15   ` Daniel Jacobowitz

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=3D494E38.3080106@ges.redhat.com \
    --to=ac131313@ges.redhat.com \
    --cc=carlton@math.stanford.edu \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=tromey@redhat.com \
    /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