Browse Source

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>
pull/22/merge
Fam Zheng 10 years ago
committed by Peter Maydell
parent
commit
db4df20de8
  1. 3
      scripts/tracetool/backend/simple.py

3
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

Loading…
Cancel
Save