public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Manuel López-Ibáñez" <lopezibanez@gmail.com>
To: Jeff Law <"law@redhat.com">, Tom Tromey <"tom@tromey.com">
Cc: Jan Kratochvil <"jan.kratochvil@redhat.com">,
	 gcc-patches@gcc.gnu.org, Phil Muldoon <"pmuldoon@redhat.com">,
	 Alexandre Oliva <"aoliva@redhat.com">
Subject: Re: ping: [gcc patch] libcc1: '@' GDB array operator
Date: Wed, 03 Jun 2015 18:38:00 -0000	[thread overview]
Message-ID: <556F430F.7060807@gmail.com> (raw)
In-Reply-To: <556F2BAE.70303@redhat.com>

On 03/06/15 18:30, Jeff Law wrote:
>> It's common to have something like the struct hack where the length of
>> the array is stored in the struct.  Then when scripting gdb one can
>> write:
>>
>>      print s.array[0] @ s.length
> Which is case that I've had use for a non-constant  RHS as well.  I just
> haven't had to use it all that much.

To implement that case, you still do not need the compiler to parse @, you just 
need the compiler to parse s.array[0] and s.length independently. It should be 
possible to arrange the inferior code in such a way that GCC parses each side 
of @ independently and gives the info necessary to GDB such that it can 
interpret what @ means or give a reasonable error.

I discussed this at length here: https://gcc.gnu.org/ml/gcc/2015-03/msg00187.html

At https://gcc.gnu.org/ml/gcc/2015-03/msg00183.html I propose other 
alternatives, which in principle are more work to implement, but move GCC in 
the direction of being able to parse snippets of code. In my opinion this is 
moving backwards: making GCC less flexible and adding very special cases that 
are likely to conflict with other things.

Parsing correctly arbitrary programs that may contain @ at arbitrary places 
seems a can full of gigantic were-worms.

Cheers,

Manuel.

  reply	other threads:[~2015-06-03 18:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-27 16:36 Jan Kratochvil
2015-04-17 15:17 ` ping: " Jan Kratochvil
2015-05-30  8:33   ` Jeff Law
2015-05-30 12:12     ` Jan Kratochvil
2015-05-31 19:52       ` [gcc patchv2] " Jan Kratochvil
2015-06-03 15:09       ` ping: [gcc patch] " Jeff Law
2015-06-03 15:34         ` Tom Tromey
2015-06-03 16:31           ` Jeff Law
2015-06-03 18:38             ` Manuel López-Ibáñez [this message]
2015-06-03 18:55               ` Tom Tromey
2015-06-03 21:08         ` Jan Kratochvil
2015-06-04  7:36           ` Manuel López-Ibáñez
2015-06-04  8:17             ` Jan Kratochvil
2015-06-04  8:42               ` Manuel López-Ibáñez
2015-06-04  8:56                 ` Jan Kratochvil
2015-06-04  9:15                 ` Jakub Jelinek
2015-06-04 13:36                   ` Jan Kratochvil
2015-06-04 14:03               ` Jeff Law
2015-06-04 14:37                 ` Jan Kratochvil
2015-06-04 14:43                   ` Jeff Law

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=556F430F.7060807@gmail.com \
    --to=lopezibanez@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).