From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52993 invoked by alias); 18 May 2017 21:42:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 52974 invoked by uid 89); 18 May 2017 21:42:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=HTo:U*schwab, claims, truly X-HELO: outbound-ss-1812.hostmonster.com Received: from gproxy1-pub.mail.unifiedlayer.com (HELO outbound-ss-1812.hostmonster.com) (69.89.25.95) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 May 2017 21:42:07 +0000 Received: from CMOut01 (cmgw2 [10.0.90.82]) by gproxy1.mail.unifiedlayer.com (Postfix) with ESMTP id 9D80E178035 for ; Thu, 18 May 2017 15:41:08 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by CMOut01 with id Mxh51v00b2f2jeq01xh8Nc; Thu, 18 May 2017 15:41:08 -0600 X-Authority-Analysis: v=2.2 cv=K+5SJ2eI c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=tJ8p9aeEuA8A:10 a=zstS-IiYAAAA:8 a=rwYWLMBtYaLSd1z0heEA:9 a=S_HVFEA2qnQA:10 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from 174-29-43-217.hlrn.qwest.net ([174.29.43.217]:46600 helo=pokyo) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1dBTAP-00038H-7P; Thu, 18 May 2017 15:41:05 -0600 From: Tom Tromey To: Andreas Schwab Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFA] Use watchpoint's language when re-parsing expression References: <20170518023916.19913-1-tom@tromey.com> Date: Thu, 18 May 2017 21:42:00 -0000 In-Reply-To: (Andreas Schwab's message of "Thu, 18 May 2017 09:37:55 +0200") Message-ID: <8760gxc07m.fsf@pokyo> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BWhitelist: no X-Exim-ID: 1dBTAP-00038H-7P X-Source-Sender: 174-29-43-217.hlrn.qwest.net (pokyo) [174.29.43.217]:46600 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-SW-Source: 2017-05/txt/msg00424.txt.bz2 >>>>> "Andreas" == Andreas Schwab writes: Andreas> On Mai 17 2017, Tom Tromey 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