print ' Dump%s(%s);' % (self.id, instance)
-class Literal(Concrete):
+class Literal(Type):
def __init__(self, expr, format, base=10):
- Concrete.__init__(self, expr)
+ Type.__init__(self, expr)
self.format = format
def visit(self, visitor, *args, **kwargs):
return visitor.visit_literal(self, *args, **kwargs)
- def _dump(self, instance):
+ def dump(self, instance):
print ' Log::Literal%s(%s);' % (self.format, instance)
def dump(self, instance):
print ' if(%s) {' % instance
- print ' Log::BeginPointer("%s", (const void *)%s);' % (self.type, instance)
+ print ' Log::BeginPointer((const void *)%s);' % (instance,)
self.type.dump("*" + instance)
print ' Log::EndPointer();'
print ' }'
def _dump(self, instance):
print ' %s l_Value = %s;' % (self.type, instance)
- print ' Log::BeginBitmask("%s");' % (self.type,)
+ print ' Log::BeginBitmask();'
for value in self.values:
print ' if((l_Value & %s) == %s) {' % (value, value)
print ' Log::LiteralNamedConstant("%s", %s);' % (value, value)
def dump(self, instance):
print ' if(%s) {' % instance
index = '__i' + self.type.id
- print ' Log::BeginArray("%s", %s);' % (self.type, self.length)
+ print ' Log::BeginArray(%s);' % (self.length,)
print ' for (int %s = 0; %s < %s; ++%s) {' % (index, index, self.length, index)
- print ' Log::BeginElement("%s");' % (self.type,)
+ print ' Log::BeginElement();'
self.type.dump('(%s)[%s]' % (instance, index))
print ' Log::EndElement();'
print ' }'
return visitor.visit_struct(self, *args, **kwargs)
def _dump(self, instance):
- print ' Log::BeginStruct("%s");' % (self.name,)
+ print ' Log::BeginStruct("%s");' % self.name
for type, name in self.members:
- print ' Log::BeginMember("%s", "%s");' % (type, name)
+ print ' Log::BeginMember("%s");' % (name,)
type.dump('(%s).%s' % (instance, name))
print ' Log::EndMember();'
print ' Log::EndStruct();'
for arg in self.args:
if not arg.output:
arg.type.unwrap_instance(arg.name)
- print ' Log::BeginArg("%s", "%s");' % (arg.type, arg.name)
+ print ' Log::BeginArg("%s");' % (arg.name,)
arg.type.dump(arg.name)
print ' Log::EndArg();'
print ' %s%s(%s);' % (result, pvalue, ', '.join([str(arg.name) for arg in self.args]))
for arg in self.args:
if arg.output:
- print ' Log::BeginArg("%s", "%s");' % (arg.type, arg.name)
+ print ' Log::BeginArg("%s");' % (arg.name,)
arg.type.dump(arg.name)
print ' Log::EndArg();'
arg.type.wrap_instance(arg.name)
if self.type is not Void:
- print ' Log::BeginReturn("%s");' % self.type
+ print ' Log::BeginReturn();'
self.type.dump("result")
print ' Log::EndReturn();'
self.type.wrap_instance('result')
print ' %s result;' % method.type
result = 'result = '
print ' Log::BeginCall("%s");' % (self.name + '::' + method.name)
- print ' Log::BeginArg("%s *", "this");' % self.name
- print ' Log::BeginPointer("%s", (const void *)m_pInstance);' % self.name
- print ' Log::EndPointer();'
+ print ' Log::BeginArg("this");'
+ print ' Log::LiteralOpaque((const void *)m_pInstance);'
print ' Log::EndArg();'
for arg in method.args:
if not arg.output:
arg.type.unwrap_instance(arg.name)
- print ' Log::BeginArg("%s", "%s");' % (arg.type, arg.name)
+ print ' Log::BeginArg("%s");' % (arg.name,)
arg.type.dump(arg.name)
print ' Log::EndArg();'
print ' %sm_pInstance->%s(%s);' % (result, method.name, ', '.join([str(arg.name) for arg in method.args]))
for arg in method.args:
if arg.output:
- print ' Log::BeginArg("%s", "%s");' % (arg.type, arg.name)
+ print ' Log::BeginArg("%s");' % (arg.name,)
arg.type.dump(arg.name)
print ' Log::EndArg();'
arg.type.wrap_instance(arg.name)
OS::ReleaseMutex();
}
-void BeginArg(const char *type, const char *name) {
+void BeginArg(const char *name) {
WriteByte(Trace::CALL_ARG);
WriteString(name);
}
void EndArg(void) { }
-void BeginReturn(const char *type) {
+void BeginReturn(void) {
WriteByte(Trace::CALL_RET);
}
void EndReturn(void) { }
-void BeginArray(const char *type, size_t length) {
+void BeginArray(size_t length) {
WriteByte(Trace::TYPE_ARRAY);
WriteUInt(length);
}
void EndArray(void) { }
-void BeginElement(const char *type) { }
+void BeginElement(void) { }
void EndElement(void) { }
-void BeginStruct(const char *type) {
+void BeginStruct(const char *name) {
WriteByte(Trace::TYPE_STRUCT);
}
WriteString("");
}
-void BeginMember(const char *type, const char *name) {
+void BeginMember(const char *name) {
WriteString(name);
}
void EndMember(void) { }
-void BeginBitmask(const char *type) {
+void BeginBitmask(void) {
WriteByte(Trace::TYPE_BITMASK);
}
WriteByte(Trace::TYPE_NULL);
}
-void BeginPointer(const char *type, const void *addr)
+void BeginPointer(const void *addr)
{
WriteByte(Trace::TYPE_POINTER);
WriteUInt((size_t)addr);
void BeginCall(const char *function);
void EndCall(void);
- void BeginArg(const char *type, const char *name);
+ void BeginArg(const char *name);
void EndArg(void);
- void BeginReturn(const char *type);
+ void BeginReturn(void);
void EndReturn(void);
- void BeginArray(const char *type, size_t length);
+ void BeginArray(size_t length);
void EndArray(void);
- void BeginElement(const char *type);
+ void BeginElement(void);
void EndElement(void);
- void BeginStruct(const char *type);
+ void BeginStruct(const char *name);
void EndStruct(void);
- void BeginMember(const char *type, const char *name);
+ void BeginMember(const char *name);
void EndMember(void);
- void BeginBitmask(const char *type);
+ void BeginBitmask(void);
void EndBitmask(void);
- void BeginPointer(const char *type, const void *addr);
+ void BeginPointer(const void *addr);
void EndPointer(void);
void LiteralBool(bool value);