]> git.cworth.org Git - apitrace/blobdiff - retrace/retrace_swizzle.cpp
retrace: More useful warnings for object mismatches.
[apitrace] / retrace / retrace_swizzle.cpp
index a7e777d45cba26e8da0abe4a6bf92900a1db5162..fe0df21c9deceab0dffc8e281edc00d7b8379ce7 100644 (file)
@@ -271,9 +271,18 @@ delObj(trace::Value &value) {
 }
 
 void *
-toObjPointer(trace::Value &value) {
+toObjPointer(trace::Call &call, trace::Value &value) {
     unsigned long long address = value.toUIntPtr();
-    void *obj = address ? _obj_map[address] : NULL;
+
+    void *obj;
+    if (address) {
+        obj = _obj_map[address];
+        if (!obj) {
+            warning(call) << "unknown object 0x" << std::hex << address << std::dec << " call\n";
+        }
+    } else {
+        obj = NULL;
+    }
 
     if (retrace::verbosity >= 2) {
         std::cout << std::hex << "obj 0x" << address << " <- 0x" << size_t(obj) << std::dec << "\n";