diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2016-02-01 14:13:40 +0000 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2016-03-05 21:51:01 +0000 |
commit | fdcd30bef459e9d780bcb11cbbe8a8b5f7b2998f (patch) | |
tree | b05c40fe5176dce6e6e624519754e610ea1ba1ad /wrappers | |
parent | bab1921ca9d30723323a649ac61acf9869adfb34 (diff) |
specs: Handle overloaded methods/functions.
Diffstat (limited to 'wrappers')
-rw-r--r-- | wrappers/trace.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/wrappers/trace.py b/wrappers/trace.py index ab326aa1..18c8816e 100644 --- a/wrappers/trace.py +++ b/wrappers/trace.py @@ -538,7 +538,7 @@ class Tracer: print 'static const char * _%s_args[%u] = {%s};' % (function.name, len(function.args), ', '.join(['"%s"' % arg.name for arg in function.args])) else: print 'static const char ** _%s_args = NULL;' % (function.name,) - print 'static const trace::FunctionSig _%s_sig = {%u, "%s", %u, _%s_args};' % (function.name, self.getFunctionSigId(), function.name, len(function.args), function.name) + print 'static const trace::FunctionSig _%s_sig = {%u, "%s", %u, _%s_args};' % (function.name, self.getFunctionSigId(), function.sigName(), len(function.args), function.name) print def getFunctionSigId(self): @@ -717,7 +717,7 @@ class Tracer: methods = list(interface.iterMethods()) for method in methods: - print " " + method.prototype() + ";" + print " " + method.prototype() + " override;" print for type, name, value in self.enumWrapperInterfaceVariables(interface): @@ -864,8 +864,16 @@ class Tracer: def implementWrapperInterfaceMethodBody(self, interface, base, method): assert not method.internal - print ' static const char * _args[%u] = {%s};' % (len(method.args) + 1, ', '.join(['"this"'] + ['"%s"' % arg.name for arg in method.args])) - print ' static const trace::FunctionSig _sig = {%u, "%s", %u, _args};' % (self.getFunctionSigId(), interface.name + '::' + method.name, len(method.args) + 1) + sigName = interface.name + '::' + method.sigName() + if method.overloaded: + # Once the method signature name goes into a trace, we'll need to + # support it indefinetely, so log them so one can make sure nothing + # weird gets baked in + sys.stderr.write('note: overloaded method %s\n' % (sigName,)) + + numArgs = len(method.args) + 1 + print ' static const char * _args[%u] = {%s};' % (numArgs, ', '.join(['"this"'] + ['"%s"' % arg.name for arg in method.args])) + print ' static const trace::FunctionSig _sig = {%u, "%s", %u, _args};' % (self.getFunctionSigId(), sigName, numArgs) print ' unsigned _call = trace::localWriter.beginEnter(&_sig);' print ' trace::localWriter.beginArg(0);' |