diff options
-rw-r--r-- | gltrace.py | 10 | ||||
-rw-r--r-- | gui/saverthread.cpp | 4 | ||||
-rw-r--r-- | trace.py | 6 | ||||
-rw-r--r-- | trace_writer.cpp | 36 | ||||
-rw-r--r-- | trace_writer.hpp | 4 |
5 files changed, 30 insertions, 30 deletions
@@ -334,7 +334,7 @@ class GlTracer(Tracer): # Emit a fake function print ' {' print ' static const Trace::FunctionSig &__sig = %s ? __glEnableClientState_sig : __glDisableClientState_sig;' % flag_name - print ' unsigned __call = __writer.beginEnter(__sig);' + print ' unsigned __call = __writer.beginEnter(&__sig);' print ' __writer.beginArg(0);' dump_instance(glapi.GLenum, enable_name) print ' __writer.endArg();' @@ -424,7 +424,7 @@ class GlTracer(Tracer): Tracer.dispatch_function(self, function) def emit_memcpy(self, dest, src, length): - print ' unsigned __call = __writer.beginEnter(__memcpy_sig);' + print ' unsigned __call = __writer.beginEnter(&__memcpy_sig);' print ' __writer.beginArg(0);' print ' __writer.writeOpaque(%s);' % dest print ' __writer.endArg();' @@ -547,7 +547,7 @@ class GlTracer(Tracer): # Emit a fake function self.array_trace_intermezzo(api, uppercase_name) - print ' unsigned __call = __writer.beginEnter(__%s_sig);' % (function.name,) + print ' unsigned __call = __writer.beginEnter(&__%s_sig);' % (function.name,) for arg in function.args: assert not arg.output print ' __writer.beginArg(%u);' % (arg.index,) @@ -591,7 +591,7 @@ class GlTracer(Tracer): print ' size_t __size = __%s_size(%s, maxindex);' % (function.name, arg_names) # Emit a fake function - print ' unsigned __call = __writer.beginEnter(__%s_sig);' % (function.name,) + print ' unsigned __call = __writer.beginEnter(&__%s_sig);' % (function.name,) for arg in function.args: assert not arg.output print ' __writer.beginArg(%u);' % (arg.index,) @@ -658,7 +658,7 @@ class GlTracer(Tracer): self.fake_call(function, [texture]) def fake_call(self, function, args): - print ' unsigned __fake_call = __writer.beginEnter(__%s_sig);' % (function.name,) + print ' unsigned __fake_call = __writer.beginEnter(&__%s_sig);' % (function.name,) for arg, instance in zip(function.args, args): assert not arg.output print ' __writer.beginArg(%u);' % (arg.index,) diff --git a/gui/saverthread.cpp b/gui/saverthread.cpp index a7906450..d7f6906c 100644 --- a/gui/saverthread.cpp +++ b/gui/saverthread.cpp @@ -173,7 +173,7 @@ writeValue(Trace::Writer &writer, const QVariant &var, unsigned &id) } else if (type == bitmaskType) { ApiBitmask bm = var.value<ApiBitmask>(); Trace::BitmaskSig *sig = createBitmaskSig(bm, ++id); - writer.writeBitmask(*sig, bm.value()); + writer.writeBitmask(sig, bm.value()); deleteBitmaskSig(sig); } else if (type == structType) { ApiStruct apiStr = var.value<ApiStruct>(); @@ -226,7 +226,7 @@ void SaverThread::run() for (int i = 0; i < m_calls.count(); ++i) { ApiTraceCall *call = m_calls[i]; Trace::FunctionSig *funcSig = createFunctionSig(call, ++id); - unsigned callNo = writer.beginEnter(*funcSig); + unsigned callNo = writer.beginEnter(funcSig); { //args QVariantList vars = call->arguments(); @@ -175,7 +175,7 @@ class DumpImplementer(stdapi.Visitor): print ' __traceEnum%s(%s);' % (enum.id, instance) def visit_bitmask(self, bitmask, instance): - print ' __writer.writeBitmask(__bitmask%s_sig, %s);' % (bitmask.id, instance) + print ' __writer.writeBitmask(&__bitmask%s_sig, %s);' % (bitmask.id, instance) def visit_pointer(self, pointer, instance): print ' if (%s) {' % instance @@ -345,7 +345,7 @@ class Tracer: print def trace_function_impl_body(self, function): - print ' unsigned __call = __writer.beginEnter(__%s_sig);' % (function.name,) + print ' unsigned __call = __writer.beginEnter(&__%s_sig);' % (function.name,) for arg in function.args: if not arg.output: self.unwrap_arg(function, arg) @@ -410,7 +410,7 @@ class Tracer: print method.prototype(interface_wrap_name(interface) + '::' + method.name) + ' {' 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};' % (int(method.id), interface.name + '::' + method.name, len(method.args) + 1) - print ' unsigned __call = __writer.beginEnter(__sig);' + print ' unsigned __call = __writer.beginEnter(&__sig);' print ' __writer.beginArg(0);' print ' __writer.writeOpaque((const void *)m_pInstance);' print ' __writer.endArg();' diff --git a/trace_writer.cpp b/trace_writer.cpp index 19f7cc01..700f5118 100644 --- a/trace_writer.cpp +++ b/trace_writer.cpp @@ -181,7 +181,7 @@ inline bool lookup(std::vector<bool> &map, size_t index) { } } -unsigned Writer::beginEnter(const FunctionSig &function) { +unsigned Writer::beginEnter(const FunctionSig *sig) { OS::AcquireMutex(); if (!g_gzFile) { @@ -189,14 +189,14 @@ unsigned Writer::beginEnter(const FunctionSig &function) { } _writeByte(Trace::EVENT_ENTER); - _writeUInt(function.id); - if (!lookup(functions, function.id)) { - _writeString(function.name); - _writeUInt(function.num_args); - for (unsigned i = 0; i < function.num_args; ++i) { - _writeString(function.arg_names[i]); + _writeUInt(sig->id); + if (!lookup(functions, sig->id)) { + _writeString(sig->name); + _writeUInt(sig->num_args); + for (unsigned i = 0; i < sig->num_args; ++i) { + _writeString(sig->arg_names[i]); } - functions[function.id] = true; + functions[sig->id] = true; } return call_no++; @@ -326,19 +326,19 @@ void Writer::writeEnum(const EnumSig *sig) { } } -void Writer::writeBitmask(const BitmaskSig &bitmask, unsigned long long value) { +void Writer::writeBitmask(const BitmaskSig *sig, unsigned long long value) { _writeByte(Trace::TYPE_BITMASK); - _writeUInt(bitmask.id); - if (!lookup(bitmasks, bitmask.id)) { - _writeUInt(bitmask.num_flags); - for (unsigned i = 0; i < bitmask.num_flags; ++i) { - if (i != 0 && bitmask.flags[i].value == 0) { - OS::DebugMessage("apitrace: bitmask %s is zero but is not first flag\n", bitmask.flags[i].name); + _writeUInt(sig->id); + if (!lookup(bitmasks, sig->id)) { + _writeUInt(sig->num_flags); + for (unsigned i = 0; i < sig->num_flags; ++i) { + if (i != 0 && sig->flags[i].value == 0) { + OS::DebugMessage("apitrace: sig %s is zero but is not first flag\n", sig->flags[i].name); } - _writeString(bitmask.flags[i].name); - _writeUInt(bitmask.flags[i].value); + _writeString(sig->flags[i].name); + _writeUInt(sig->flags[i].value); } - bitmasks[bitmask.id] = true; + bitmasks[sig->id] = true; } _writeUInt(value); } diff --git a/trace_writer.hpp b/trace_writer.hpp index c5f54aed..3b7955e6 100644 --- a/trace_writer.hpp +++ b/trace_writer.hpp @@ -87,7 +87,7 @@ namespace Trace { bool open(const char *filename); void close(void); - unsigned beginEnter(const FunctionSig &function); + unsigned beginEnter(const FunctionSig *sig); void endEnter(void); void beginLeave(unsigned call); @@ -118,7 +118,7 @@ namespace Trace { void writeWString(const wchar_t *str); void writeBlob(const void *data, size_t size); void writeEnum(const EnumSig *sig); - void writeBitmask(const BitmaskSig &bitmask, unsigned long long value); + void writeBitmask(const BitmaskSig *sig, unsigned long long value); void writeNull(void); void writeOpaque(const void *ptr); |