summaryrefslogtreecommitdiffstats
path: root/scripts/tracetool
diff options
context:
space:
mode:
authorFam Zheng2016-10-26 05:50:06 +0200
committerPeter Maydell2016-10-27 20:24:15 +0200
commitdb4df20de86c6e8ecd6c9f042c029ffb9f9cddac (patch)
treed29b9a49b1fbbb98167e7539519ab382f3f7136b /scripts/tracetool
parentMerge remote-tracking branch 'remotes/kraxel/tags/pull-audio-20161027-1' into... (diff)
downloadqemu-db4df20de86c6e8ecd6c9f042c029ffb9f9cddac.tar.gz
qemu-db4df20de86c6e8ecd6c9f042c029ffb9f9cddac.tar.xz
qemu-db4df20de86c6e8ecd6c9f042c029ffb9f9cddac.zip
trace: Fix 'char **' compilation error in simple backend
Currently, the generated function body will do "strlen(arg)" but the argument could be 'char **' or 'char * const *'. Avoid that by excluding such cases in is_string check. Reported by patchew's "make docker-test-mingw@fedora". Suggested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1477453806-21097-1-git-send-email-famz@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/tracetool')
-rw-r--r--scripts/tracetool/backend/simple.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/tracetool/backend/simple.py b/scripts/tracetool/backend/simple.py
index 9885e83cd4..85f61028e2 100644
--- a/scripts/tracetool/backend/simple.py
+++ b/scripts/tracetool/backend/simple.py
@@ -21,7 +21,8 @@ PUBLIC = True
def is_string(arg):
strtype = ('const char*', 'char*', 'const char *', 'char *')
- if arg.lstrip().startswith(strtype):
+ arg_strip = arg.lstrip()
+ if arg_strip.startswith(strtype) and arg_strip.count('*') == 1:
return True
else:
return False