Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Andreas Schwab <schwab@suse.de>
Cc: Tom Tromey <tom@tromey.com>,  gdb-patches@sourceware.org
Subject: Re: [RFA] Use watchpoint's language when re-parsing expression
Date: Thu, 18 May 2017 21:42:00 -0000	[thread overview]
Message-ID: <8760gxc07m.fsf@pokyo> (raw)
In-Reply-To: <mvminky1up8.fsf@suse.de> (Andreas Schwab's message of "Thu, 18	May 2017 09:37:55 +0200")

>>>>> "Andreas" == Andreas Schwab <schwab@suse.de> writes:

Andreas> On Mai 17 2017, Tom Tromey <tom@tromey.com> wrote:
>> So, in the end I made a hook to let each language choose what
>> expression to use.  I made all the languages other than Rust use the C
>> expression, because that is the status quo ante.  However, this is
>> probably not truly correct.  After this patch, at least, it is easy to
>> correct by someone who knows the language(s) in question.

Andreas> The docs say that gdb is supposed to support C style casts in every
Andreas> language.  Also, there is the {type} operator that is also supported in
Andreas> every language.

I never noticed that before.  However, I don't think it is a good reason
to reject this patch.

First, the docs are simply incorrect now, as the Rust parser doesn't
support this, and I don't think it ought to.  The docs state the
rationale for this as being the usefulness of casting -- and while it's
indeed useful, Rust already supports a syntax for this, so implementing
the C syntax additionally seems strange.

Second, while the cast is supported, nothing in the docs claims that the
prefix "*" is supported by all languages.  So, even if you accept the
cast part of the expression (which you shouldn't), the expression as a
whole is still wrong.

Finally, I'm not at all certain that C-style casts or the {type}
operator can be added to the Rust expression parser without breaking
something else.  And, that seems like a complex request just to unbreak
what amount to an implementation detail.

Tom


  reply	other threads:[~2017-05-18 21:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18  2:39 Tom Tromey
2017-05-18  7:37 ` Andreas Schwab
2017-05-18 21:42   ` Tom Tromey [this message]
2017-05-19 13:51     ` Joel Brobecker
2017-05-19 14:32       ` Pedro Alves
2017-05-20  4:07         ` Tom Tromey
2017-05-20  8:24           ` Andreas Schwab

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=8760gxc07m.fsf@pokyo \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=schwab@suse.de \
    /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