diff --git a/scripts/tracetool/__init__.py b/scripts/tracetool/__init__.py index 49858c9e33db2a2ad0ceb5f8c27ac5a1792ce31d..175df0800529c80272479e8e210ebbffd4c7cd52 100644 --- a/scripts/tracetool/__init__.py +++ b/scripts/tracetool/__init__.py @@ -64,14 +64,17 @@ class Arguments: res = [] for arg in arg_str.split(","): arg = arg.strip() - parts = arg.split() - head, sep, tail = parts[-1].rpartition("*") - parts = parts[:-1] - if tail == "void": - assert len(parts) == 0 and sep == "" + if arg == 'void': continue - arg_type = " ".join(parts + [ " ".join([head, sep]).strip() ]).strip() - res.append((arg_type, tail)) + + if '*' in arg: + arg_type, identifier = arg.rsplit('*', 1) + arg_type += '*' + identifier = identifier.strip() + else: + arg_type, identifier = arg.rsplit(None, 1) + + res.append((arg_type, identifier)) return Arguments(res) def __iter__(self):