@@ -42,6 +42,8 @@ def out(*lines, **kwargs):
sys.stdout.writelines("\n".join(lines) + "\n")
+FORBIDDEN = ["new", "class"]
+
class Arguments:
"""Event arguments description."""
@@ -85,6 +87,9 @@ class Arguments:
else:
arg_type, identifier = arg.rsplit(None, 1)
+ if identifier in FORBIDDEN:
+ identifier += "_"
+
res.append((arg_type, identifier))
return Arguments(res)
@@ -230,7 +235,10 @@ class Event(object):
fmt_trans = groups["fmt_trans"]
if len(fmt_trans) > 0:
fmt = [fmt_trans, fmt]
- args = Arguments.build(groups["args"])
+ try:
+ args = Arguments.build(groups["args"])
+ except ForbiddenArgumentError as e:
+ error("Error: event '%s' uses forbidden argument name '%s'" % (name, e.name))
if "tcg-trans" in props:
raise ValueError("Invalid property 'tcg-trans'")
Allows instrumentation clients in C++ to use the auto-generated headers. Signed-off-by: Lluís Vilanova <vilanova@ac.upc.edu> --- scripts/tracetool/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)