trace: Fix 'char **' compilation error in simple backend
PATCH v2 1/1 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".
---
v2: Fix typo in commit message and "yeah we'll be counting stars". [Eric]
--- scripts/tracetool/backend/simple.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/tracetool/backend/simple.py +2 -1
@@ -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
Signature · 1 line
2.7.4
Quoted 4 lines · Fam Zheng
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_stringcheck.
Quoted 8 lines
Reported by patchew's "make docker-test-mingw@fedora".
Suggested-by Eric Blake <[email protected]>Signed-off-by Fam Zheng <[email protected]>---
v2: Fix typo in commit message and "yeah we'll be counting stars". [Eric]
I may have had the vague idea, but you eloquently framed it into code, and let me learn in the process :)
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Quoted 10 lines · Eric Blake
Quoted 9 lines · Fam Zheng
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_stringcheck.Reported by patchew's "make docker-test-mingw@fedora".
Suggested-by Eric Blake <[email protected]>Signed-off-by Fam Zheng <[email protected]>
Quoted 8 lines
Quoted 3 lines
---
v2: Fix typo in commit message and "yeah we'll be counting stars". [Eric]
I may have had the vague idea, but you eloquently framed it into code, and let me learn in the process :)
Reviewed-by Eric Blake <[email protected]>
Applied to master as a buildfix, thanks (though it looks like there is also a trace related compile failure for the UST backend, so this alone won't be enough to bring travis back to all-green).
-- PMM