xemu/scripts/tracetool
Stefan Hajnoczi 7fb48c0ee1 tracetool: show trace-events filename/lineno in fmt string errors
The compiler encounters trace event format strings in generated code.
Format strings are error-prone and therefore clear compiler errors are
important.

Use the #line directive to show the trace-events filename and line
number in format string errors:
https://gcc.gnu.org/onlinedocs/gcc-10.2.0/cpp/Line-Control.html

For example, if the cpu_in trace event's %u is changed to %p the
following error is reported:

  trace-events:29:18: error: format ‘%p’ expects argument of type ‘void *’, but argument 7 has type ‘unsigned int’ [-Werror=format=]

Line 29 in trace-events is where cpu_in is defined. This works for any
trace-events file in the QEMU source tree and the correct path is
displayed.

Unfortunately there does not seem to be a way to set the column, so "18"
is not the right character on that line.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20200827142915.108730-5-stefanha@redhat.com>
2021-01-04 14:24:58 +00:00
..
backend tracetool: show trace-events filename/lineno in fmt string errors 2021-01-04 14:24:58 +00:00
format scripts/tracetool: silence SystemTap dtrace(1) long long warnings 2020-11-11 13:10:38 +00:00
__init__.py tracetool: add input filename and line number to Event 2021-01-04 14:24:58 +00:00
transform.py scripts/tracetool: Update maintainer email address 2020-06-24 11:21:00 +01:00
vcpu.py scripts/tracetool: Use void pointer for vcpu 2020-09-09 17:16:15 +01:00