qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/2] qapi: Add comments to aid debugging generat


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 1/2] qapi: Add comments to aid debugging generated introspection
Date: Fri, 29 Jun 2018 15:53:41 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]