From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/6] Remove OP_LABELED.
Date: Fri, 02 Nov 2012 16:43:00 -0000 [thread overview]
Message-ID: <5093F814.6080308@redhat.com> (raw)
In-Reply-To: <1351756007-18242-2-git-send-email-yao@codesourcery.com>
On 11/01/2012 07:46 AM, Yao Qi wrote:
>
> -/* Used to represent named structure field values in brace
> - initializers (or tuples as they are called in (the deleted)
> - Chill).
> -
> - The gcc C syntax is NAME:VALUE or .NAME=VALUE, the (the
> - deleted) Chill syntax is .NAME:VALUE. Multiple labels (as in
> - the (the deleted) Chill syntax .NAME1,.NAME2:VALUE) is
> - represented as if it were .NAME1:(.NAME2:VALUE) (though that is
> - not valid (the deleted) Chill syntax).
I found this mention of C syntax curious, and tried it, to see if
we're implementing that in some other way, perhaps. It seems to be
talking about designated initializers
(<http://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html>,
at least the .NAME=VALUE variant). Doesn't work unfortunately:
(debug gdb, and run to main)
(top-gdb) p args
$1 = {argc = 8450672, argv = 0x457990 <_start>, use_windows = -9104, interpreter_p = 0x0}
(top-gdb) p args = {0}
$2 = {argc = 0, argv = 0x0, use_windows = 0, interpreter_p = 0x0}
(top-gdb) p args = {1, 0}
$3 = {argc = 1, argv = 0x0, use_windows = 0, interpreter_p = 0x0}
(top-gdb) p args = {.argc = 1, 0}
A syntax error in expression, near `.argc = 1, 0}'.
Seems like something we should/could support. I'll file a PR, unless I
missed something.
I have no idea if the OP_LABELED implementation was a good basis for this
or not.
> -
> - The NAME is represented as for STRUCTOP_STRUCT; VALUE follows. */
> -OP (OP_LABELED)
> -
--
Pedro Alves
next prev parent reply other threads:[~2012-11-02 16:43 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-01 7:47 [PATCH 0/6] Remove unused operator OP_LABELED Yao Qi
2012-11-01 7:47 ` [PATCH 2/6] Update comment of evaluate_struct_tuple Yao Qi
2012-11-01 15:42 ` Tom Tromey
2012-11-01 7:47 ` [PATCH 4/6] Remove 'substruct_type' and 'subfieldno' Yao Qi
2012-11-01 15:44 ` Tom Tromey
2012-11-01 7:47 ` [PATCH 6/6] Test nested struct assign Yao Qi
2012-11-01 15:47 ` Tom Tromey
2012-11-01 7:47 ` [PATCH 3/6] Remove 'variantno' Yao Qi
2012-11-01 15:44 ` Tom Tromey
2012-11-01 7:47 ` [PATCH 5/6] Indentation Yao Qi
2012-11-01 15:45 ` Tom Tromey
2012-11-01 7:47 ` [PATCH 1/6] Remove OP_LABELED Yao Qi
2012-11-01 15:41 ` Tom Tromey
2012-11-02 16:43 ` Pedro Alves [this message]
2012-11-02 16:49 ` Tom Tromey
2012-11-02 16:51 ` Pedro Alves
2012-11-02 17:09 ` Tom Tromey
2012-11-02 17:25 ` Pedro Alves
2012-11-01 15:47 ` [PATCH 0/6] Remove unused operator OP_LABELED Tom Tromey
2012-11-02 0:20 ` [committed]: " Yao Qi
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=5093F814.6080308@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=yao@codesourcery.com \
/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