X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace.py;h=0e28d18b4a64618db8fb10b0e5b4faa407137df5;hb=59ee88ea99b6de592b32d635e097a759b7f70e23;hp=96a09abc1fcd623048453a578d202d612c6e10e3;hpb=568ecc29ff1a22d8ad059bade28ac79728b92958;p=apitrace diff --git a/retrace.py b/retrace.py index 96a09ab..0e28d18 100644 --- a/retrace.py +++ b/retrace.py @@ -94,8 +94,15 @@ class ValueDeserializer(stdapi.Visitor): print ' %s = NULL;' % lvalue print ' }' + def visitIntPointer(self, pointer, lvalue, rvalue): + print ' %s = static_cast<%s>((%s).toPointer());' % (lvalue, pointer, rvalue) + + def visitLinearPointer(self, pointer, lvalue, rvalue): + print ' %s = static_cast<%s>(retrace::toPointer(%s));' % (lvalue, pointer, rvalue) + def visitHandle(self, handle, lvalue, rvalue): - OpaqueValueDeserializer().visit(handle.type, lvalue, rvalue); + #OpaqueValueDeserializer().visit(handle.type, lvalue, rvalue); + self.visit(handle.type, lvalue, rvalue); new_lvalue = lookupHandle(handle, lvalue) print ' if (retrace::verbosity >= 2) {' print ' std::cout << "%s " << size_t(%s) << " <- " << size_t(%s) << "\\n";' % (handle.name, lvalue, new_lvalue) @@ -155,6 +162,14 @@ class SwizzledValueRegistrator(stdapi.Visitor): finally: print ' }' + def visitIntPointer(self, pointer, lvalue, rvalue): + pass + + def visitLinearPointer(self, pointer, lvalue, rvalue): + assert pointer.size is not None + if pointer.size is not None: + print r' retrace::addRegion((%s).toUIntPtr(), %s, %s);' % (rvalue, lvalue, pointer.size) + def visitHandle(self, handle, lvalue, rvalue): print ' %s __orig_result;' % handle.type OpaqueValueDeserializer().visit(handle.type, '__orig_result', rvalue); @@ -251,7 +266,7 @@ class Retracer: visitor.visit(type, lvalue, rvalue) def invokeFunction(self, function): - arg_names = ", ".join([arg.name for arg in function.args]) + arg_names = ", ".join(function.argNames()) if function.type is not stdapi.Void: print ' %s __result;' % (function.type) print ' __result = %s(%s);' % (function.name, arg_names)