X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=retrace%2Fretrace.py;h=c4ad2d2bb494aceb861dcf163818bb702af58622;hb=66ee52d87f1e740e3085dc481e2bd6a6dc41f279;hp=ecad9f45615497c6657e419f2ef2cd813ab79326;hpb=81301939f025407ceb284a9dcd5d5a1f05d27b8f;p=apitrace diff --git a/retrace/retrace.py b/retrace/retrace.py index ecad9f4..c4ad2d2 100644 --- a/retrace/retrace.py +++ b/retrace/retrace.py @@ -242,7 +242,7 @@ class SwizzledValueRegistrator(stdapi.Visitor): pass def visitObjPointer(self, pointer, lvalue, rvalue): - print r' retrace::addObj(%s, %s);' % (rvalue, lvalue) + print r' retrace::addObj(call, %s, %s);' % (rvalue, lvalue) def visitLinearPointer(self, pointer, lvalue, rvalue): assert pointer.size is not None @@ -434,6 +434,7 @@ class Retracer: if function.type is not stdapi.Void: print ' _result = %s(%s);' % (function.name, arg_names) print ' (void)_result;' + self.checkResult(function.type) else: print ' %s(%s);' % (function.name, arg_names) @@ -450,9 +451,16 @@ class Retracer: if method.type is not stdapi.Void: print ' _result = _this->%s(%s);' % (method.name, arg_names) print ' (void)_result;' + self.checkResult(method.type) else: print ' _this->%s(%s);' % (method.name, arg_names) + def checkResult(self, resultType): + if str(resultType) == 'HRESULT': + print r' if (FAILED(_result)) {' + print r' retrace::warning(call) << "failed\n";' + print r' }' + def filterFunction(self, function): return True