X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace.py;h=78762ef8760434d5fcbfac1853fc6300f55f8176;hb=e923607ddc14a2f135e2c08317833bca902b4a65;hp=22ce5eda3066ff321b578bbf09659e2ea0e8bd46;hpb=02c2500281c9af1039c272874f38e7802c9acfb9;p=apitrace diff --git a/retrace.py b/retrace.py index 22ce5ed..78762ef 100644 --- a/retrace.py +++ b/retrace.py @@ -53,8 +53,7 @@ def handle_entry(handle, value): class ValueExtractor(stdapi.Visitor): def visit_literal(self, literal, lvalue, rvalue): - #if literal.format in ('Bool', 'UInt'): - print ' %s = (%s).to%s();' % (lvalue, rvalue, literal.format) + print ' %s = (%s).to%s();' % (lvalue, rvalue, literal.kind) def visit_const(self, const, lvalue, rvalue): self.visit(const.type, lvalue, rvalue) @@ -69,7 +68,7 @@ class ValueExtractor(stdapi.Visitor): self.visit(bitmask.type, lvalue, rvalue) def visit_array(self, array, lvalue, rvalue): - print ' const Trace::Array *__a%s = dynamic_cast(&%s);' % (array.tag, rvalue) + print ' const trace::Array *__a%s = dynamic_cast(&%s);' % (array.tag, rvalue) print ' if (__a%s) {' % (array.tag) length = '__a%s->values.size()' % array.tag print ' %s = new %s[%s];' % (lvalue, array.type, length) @@ -84,7 +83,7 @@ class ValueExtractor(stdapi.Visitor): print ' }' def visit_pointer(self, pointer, lvalue, rvalue): - print ' const Trace::Array *__a%s = dynamic_cast(&%s);' % (pointer.tag, rvalue) + print ' const trace::Array *__a%s = dynamic_cast(&%s);' % (pointer.tag, rvalue) print ' if (__a%s) {' % (pointer.tag) print ' %s = new %s;' % (lvalue, pointer.type) try: @@ -134,7 +133,7 @@ class ValueWrapper(stdapi.Visitor): pass def visit_array(self, array, lvalue, rvalue): - print ' const Trace::Array *__a%s = dynamic_cast(&%s);' % (array.tag, rvalue) + print ' const trace::Array *__a%s = dynamic_cast(&%s);' % (array.tag, rvalue) print ' if (__a%s) {' % (array.tag) length = '__a%s->values.size()' % array.tag index = '__j' + array.tag @@ -146,7 +145,7 @@ class ValueWrapper(stdapi.Visitor): print ' }' def visit_pointer(self, pointer, lvalue, rvalue): - print ' const Trace::Array *__a%s = dynamic_cast(&%s);' % (pointer.tag, rvalue) + print ' const trace::Array *__a%s = dynamic_cast(&%s);' % (pointer.tag, rvalue) print ' if (__a%s) {' % (pointer.tag) try: self.visit(pointer.type, '%s[0]' % (lvalue,), '*__a%s->values[0]' % (pointer.tag,)) @@ -185,7 +184,7 @@ class ValueWrapper(stdapi.Visitor): class Retracer: def retrace_function(self, function): - print 'static void retrace_%s(Trace::Call &call) {' % function.name + print 'static void retrace_%s(trace::Call &call) {' % function.name self.retrace_function_body(function) print '}' print