This is the mail archive of the
mailing list for the GCC project.
Re: How to implement '@' GDB-like operator for libcc1
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>
- Cc: gcc at gcc dot gnu dot org, Phil Muldoon <pmuldoon at redhat dot com>
- Date: Sat, 21 Mar 2015 19:30:11 +0100
- Subject: Re: How to implement '@' GDB-like operator for libcc1
- Authentication-results: sourceware.org; auth=none
- References: <20150315192904 dot GA25492 at host1 dot jankratochvil dot net> <87pp89huk6 dot fsf at tromey dot com>
On Mon, 16 Mar 2015 15:43:21 +0100, Tom Tromey wrote:
> It seems like there should be some kind of reference to &op0, that is,
> lowering ATSIGN_EXPR to *(typeof(OP0)[OP1]*)(&OP0).
OK, I got it now. I was using GDB-like 'struct type *' where 'struct value *'
should have been as in GCC both are 'tree'.
After fixing that it started working:
ret = copy_node (op0);
TREE_TYPE (ret) = build_array_type_nelts (TREE_TYPE (op0), tree_to_uhwi (op1));
> Also, I this has to consider the case where OP1 is not a constant.
I find that already checked in gcc/c/c-typeck.c .