On 06/04/2015 01:36 AM, Jan Kratochvil wrote:
On Thu, 04 Jun 2015 09:24:36 +0200, Manuel López-Ibáñez wrote:
On 3 June 2015 at 22:58, Jan Kratochvil <jan.kratoch...@redhat.com> wrote:

In general parsing LHS vs. RHS is not so trivial:
         *array1@10
         expression wrapped into ->
         (*array2+"a@c"[1]+'@'+'\''@(*array1@10)[5])[2]


Is this a real case? I cannot understand what this means, but it could
simply be that I'm only familiar with the most basic uses of @
together with 'print'.

I made a mistake there but unimportant one, let's say the expression is:
        "a@c"[1]+'@'+'\''+(*array2@(*array1@10)[5])[2]
I do not find splitting this expression to LHS@RHS in GDB to be easy.

These two expressions are equivalent for all operations except of sizeof():
        pointer
        (*pointer@ANYTHING)

So the expression
        "a@c"[1]+'@'+'\''+(*array2@(*array1@10)[5])[2]
is equivalent to:
        "a@c"[1]+'@'+'\''+(*array2@  array1    [5])[2]
is equivalent to:
        "a@c"[1]+'@'+'\''+  array2                 [2]
There can be a GDB function which takes X and Y and evaluates:
        "a@c"[1]+'@'+'\''+(*X     @  Y         [5])[2]
There can be a GDB function which takes X and Y and evaluates:
                                   (*X     @Y )


With these constructs I want to say that it is not easy to make the LHS@RHS
split in GDB without limiting valid expressions it can accept.
But my assertion is that stuff like what you've shown above simply isn't important to handle. What we need to look at are the common cases and I haven't seen a strong argument that the common cases can't be handled by gdb.

jeff

Reply via email to