X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=wrappers%2Ftrace.py;h=4b25607879b587c42d39ad97ddb665c47707ae65;hb=53444aadac3c2a3f6b2d1ed4cf2c89424fcdc7e5;hp=10f71a4dc7a32362dfafe3d96d68705ed3578db8;hpb=a78c14780294e326d79f3968f82de1e7bab412c2;p=apitrace diff --git a/wrappers/trace.py b/wrappers/trace.py index 10f71a4..4b25607 100644 --- a/wrappers/trace.py +++ b/wrappers/trace.py @@ -212,7 +212,7 @@ class ValueSerializer(stdapi.Visitor, stdapi.ExpanderMixin): # It is currently assumed that an unknown key means that it is followed by an int value. # determine the array length which must be passed to writeArray() up front - count = '_c' + array.keyType.tag + count = '_c' + array.baseType.tag print ' {' print ' int %s;' % count print ' for (%(c)s = 0; %(array)s && %(array)s[%(c)s] != %(terminator)s; %(c)s += 2) {' \ @@ -231,10 +231,10 @@ class ValueSerializer(stdapi.Visitor, stdapi.ExpanderMixin): # for each key / key-value pair write the key and the value, if the key requires one - index = '_i' + array.keyType.tag + index = '_i' + array.baseType.tag print ' for (int %(i)s = 0; %(i)s < %(count)s; %(i)s++) {' % {'i': index, 'count': count} print ' trace::localWriter.beginElement();' - self.visitEnum(array.keyType, "%(array)s[%(i)s]" % {'array': instance, 'i': index}) + self.visit(array.baseType, "%(array)s[%(i)s]" % {'array': instance, 'i': index}) print ' trace::localWriter.endElement();' print ' if (%(i)s + 1 >= %(count)s) {' % {'i': index, 'count': count} print ' break;' @@ -259,7 +259,7 @@ class ValueSerializer(stdapi.Visitor, stdapi.ExpanderMixin): print ' default:' print ' trace::localWriter.beginElement();' print ' os::log("apitrace: warning: %s: unknown key 0x%04X, interpreting value as int\\n", ' + \ - '__FUNCTION__, int(%(array)s[%(i)s]));' % {'array': instance, 'i': index} + '__FUNCTION__, int(%(array)s[%(i)s - 1]));' % {'array': instance, 'i': index} print ' trace::localWriter.writeSInt(%(array)s[%(i)s]);' % {'array': instance, 'i': index} print ' trace::localWriter.endElement();' print ' break;'