qemu/scripts
Eric Blake 8c643361ee qapi: Add comments to aid debugging generated introspection
We consciously chose in commit 1a9a507b to hide QAPI type names
from the introspection output on the wire, but added a command
line option -u to unmask the type name when doing a debug build.
The unmask option still remains useful to some other forms of
automated analysis, so it will not be removed; however, when it
is not in use, the generated .c file can be hard to read.  At
the time when we first introduced masking, the generated file
consisted only of a monolithic C string, so there was no clean
way to inject any comments.

Later, in commit 7d0f982b, we switched the generation to output
a QLit object, in part to make it easier for future addition of
conditional compilation.  In fact, commit d626b6c1 took advantage
of this by passing a tuple instead of a bare object for encoding
the output of conditionals.  By extending that tuple, we can now
interject strategic comments.

For now, type name debug aid comments are only output once per
meta-type, rather than at all uses of the number used to encode
the type within the introspection data.  But this is still a lot
more convenient than having to regenerate the file with the
unmask operation temporarily turned on - merely search the
generated file for '"NNN" =' to learn the corresponding source
name and associated definition of type NNN.

The generated qapi-introspect.c changes only with the addition
of comments, such as:

| @@ -14755,6 +15240,7 @@
|          { "name", QLIT_QSTR("[485]"), },
|          {}
|      })),
| +    /* "485" = QCryptoBlockInfoLUKSSlot */
|      QLIT_QDICT(((QLitDictEntry[]) {
|          { "members", QLIT_QLIST(((QLitObject[]) {
|              QLIT_QDICT(((QLitDictEntry[]) {

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180827213943.33524-3-eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Rebased, update to qapi-code-gen.txt corrected]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2018-08-28 18:21:38 +02:00
..
coccinelle qobject: Replace qobject_incref/QINCREF qobject_decref/QDECREF 2018-05-04 08:27:53 +02:00
kvm python: futurize -f libfuturize.fixes.fix_print_with_import 2018-06-08 14:39:24 -03:00
modules scripts: Allow block module to not define BlockDriver 2016-10-07 14:14:06 +02:00
qapi qapi: Add comments to aid debugging generated introspection 2018-08-28 18:21:38 +02:00
qemu-guest-agent qemu-guest-agent: freeze-hook to ignore dpkg files as well 2018-08-23 18:46:25 +02:00
qemugdb scripts/qemu-gdb/timers.py: define encoding in header comment 2018-02-05 13:54:39 +01:00
qmp qmp-shell: learn to send commands with quoted arguments 2018-08-15 07:24:22 +02:00
tracetool trace: Fix format string for the struct timeval members casted to size_t 2018-06-29 15:04:18 +01:00
travis travis: add gcovr summary for GCOV build 2018-07-05 15:59:41 +01:00
analyse-9p-simpletrace.py python: futurize -f libfuturize.fixes.fix_print_with_import 2018-06-08 14:39:24 -03:00
analyse-locks-simpletrace.py python: futurize -f lib2to3.fixes.fix_tuple_params 2018-06-08 14:39:24 -03:00
analyze-inclusions Move target-* CPU file into a target/ folder 2016-12-20 21:52:12 +01:00
analyze-migration.py python: futurize -f libfuturize.fixes.fix_print_with_import 2018-06-08 14:39:24 -03:00
archive-source.sh ui: add keycodemapdb repository as a GIT submodule 2017-10-16 14:50:54 +02:00
check-qerror.sh
checkpatch.pl checkpatch: allow space in more places before a bracket 2018-08-23 18:46:25 +02:00
clean-header-guards.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
clean-includes scripts/clean-includes: added duplicate #include check 2016-10-28 18:17:23 +03:00
cleanup-trace-events.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
cocci-macro-file.h coccinelle: add g_assert_cmp* to macro file 2016-05-23 16:53:46 +02:00
coverity-model.c coverity-model: Fix replay_get_byte() 2018-07-05 15:09:52 +02:00
create_config Revert "Makefile: Rename TARGET_DIRS to TARGET_LIST" 2018-07-05 15:59:41 +01:00
decodetree.py scripts/decodetree: Fix insnmask not marked as global in main() 2018-03-26 22:34:07 +08:00
device-crash-test python: futurize -f libfuturize.fixes.fix_print_with_import 2018-06-08 14:39:24 -03:00
disas-objdump.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
dump-guest-memory.py python: futurize -f libfuturize.fixes.fix_print_with_import 2018-06-08 14:39:24 -03:00
extract-vsssdk-headers
feature_to_c.sh scripts: Use $(..) instead of deprecated .. 2016-06-07 18:19:23 +03:00
get_maintainer.pl scripts/get_maintainer.pl: Print proper error message for missing $file 2018-03-26 14:37:12 +02:00
git-submodule.sh build: fix typo in error message 2018-02-10 10:17:06 +03:00
git.orderfile add scripts/git.orderfile 2017-07-20 09:56:41 +02:00
gtester-cat
hxtool qemu-options: Remove stray colons from output of --help 2017-12-20 09:04:27 +01:00
make_device_config.sh scripts: Use $(..) instead of deprecated .. 2016-06-07 18:19:23 +03:00
make-release scripts/make-release: Don't archive .git files 2018-02-10 10:11:20 +03:00
qapi-gen.py qapi: Lift error reporting from QAPISchema.__init__() to callers 2018-03-02 13:14:09 -06:00
qemu-binfmt-conf.sh qemu-binfmt-conf.sh: add x86_64 target 2018-08-17 13:56:33 +02:00
qemu-gdb.py scripts/qemu-gdb/timers.py: new helper to dump timer state 2018-01-16 14:54:51 +01:00
qemu.py scripts/qemu.py: introduce set_console() method 2018-06-15 16:10:11 -03:00
qtest.py qtest.py: Few pylint/style fixes 2017-09-15 20:12:00 -03:00
refresh-pxe-roms.sh
replay-dump.py python: futurize -f libfuturize.fixes.fix_print_with_import 2018-06-08 14:39:24 -03:00
shaderinclude.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
show-fixed-bugs.sh scripts: Add a script to check for bug URLs in the git log 2016-09-22 20:20:53 +02:00
signrom.py python: futurize -f libfuturize.fixes.fix_print_with_import 2018-06-08 14:39:24 -03:00
simpletrace.py simpletrace: Convert name from mapping record to str 2018-06-29 15:04:18 +01:00
switch-timer-api scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
texi2pod.pl scripts: Switch to more portable Perl shebang 2017-05-10 10:19:24 +03:00
tracetool.py trace: include filename when printing parser error messages 2018-03-12 11:10:20 +00:00
update-linux-headers.sh update-linux-headers.sh: add qemu_fw_cfg.h 2018-08-23 18:46:25 +02:00
vmstate-static-checker.py python: futurize -f libfuturize.fixes.fix_next_call 2018-06-08 14:39:24 -03:00