From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com, Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] qapi: Add comments to aid debugging generated introspection
Date: Fri, 29 Jun 2018 15:53:41 -0500 [thread overview]
Message-ID: <8d5a8cdd-bf7a-2dd2-b97f-dfcaa37111c6@redhat.com> (raw)
In-Reply-To: <20180629195544.34263-2-eblake@redhat.com>
On 06/29/2018 02:55 PM, Eric Blake wrote:
> The generated qapi-introspect.c changes only with the addition
> of comments, such as:
>
> | @@ -14927,6 +15410,7 @@
> | {}
> | })),
> | QLIT_QDICT(((QLitDictEntry[]) {
> | + /* QCryptoBlockInfoLUKSSlot */
> | { "members", QLIT_QLIST(((QLitObject[]) {
> | QLIT_QDICT(((QLitDictEntry[]) {
> | { "name", QLIT_QSTR("active") },
---
...
> @@ -128,6 +131,8 @@ const QLitObject %(c_name)s = %(c_string)s;
>
> def _gen_qlit(self, name, mtype, obj):
> if mtype not in ('command', 'event', 'builtin', 'array'):
> + if not self._unmask:
> + obj['comment'] = name
If desired, we could change this to:
if not self._unmask:
obj['comment'] = '"%s" = %s' % (self._name(name), name)
to produce comments like /* "0" = q_empty */
for even easier debugging (if I see a line containing "ret-type",
QLIT_QSTR("0"), then I can grep for '"0" =' to directly look up the type
name, rather than having to grep for 'name.*"0"' then scrolling back to
find the associated comment).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2018-06-29 20:53 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-29 19:55 [Qemu-devel] [PATCH 0/2] qapi: easier debugging of introspection file Eric Blake
2018-06-29 19:55 ` [Qemu-devel] [PATCH 1/2] qapi: Add comments to aid debugging generated introspection Eric Blake
2018-06-29 20:09 ` Eric Blake
2018-07-02 18:43 ` Markus Armbruster
2018-07-02 19:59 ` Eric Blake
2018-07-03 5:38 ` Markus Armbruster
2018-06-29 20:53 ` Eric Blake [this message]
2018-06-29 19:55 ` [Qemu-devel] [PATCH 2/2] qapi: Drop qapi-gen --unmask option Eric Blake
2018-06-29 20:18 ` Eduardo Habkost
2018-07-02 18:48 ` Markus Armbruster
2018-07-02 19:55 ` Eric Blake
2018-07-03 5:51 ` Markus Armbruster
2018-07-03 12:44 ` Eric Blake
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=8d5a8cdd-bf7a-2dd2-b97f-dfcaa37111c6@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.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 NNTP newsgroup(s).